The Flash is faster! Sonic’s top speed is Mach 1.2 (lightspeed and greater measurements are not canon and the result of unintentional graphics quirks from the older era of games and other noncanon media inclusions!) while the Flash’s top speed (both Barry Allen and Jay Garrick iterations!) is >= 186000 mps, the speed of light. On a less serious note, light (“flash”) is faster than sound (“sonic”)!