This kind of crossover question depends on which version of each character you use. In many comic stories, Flash is shown moving far beyond the speed of light. Sonic is extremely fast in his games, but usually not portrayed at that same level. The winner would likely change depending on the canon being used.