Goku's power is insane compared to Sonic's, with him being over 40,000x the baseline of his tier whereas Sonic has no such massive amps to his stats, so it would be most appropriate to put him at baseline.
In terms of hacks, the profiles for Sonic and Goku lack substantial evidence to prove claims like godly regen, conceptual erasure, resistances, etc. They just say things and scale off other parts of the series or try to just overload. Thus that which is not proven can be dismissed via Hitchen's Razor. That said, Sonic has more hacks on his profile, but a number of them are essentially useless like surface scaling and positive emotion manipulation. Sonic can weaken his foes and tank attacks on a similar level to his own, but Goku has insta-kill powers and unlike his main timeline counterpart, doesn't have any of the 'dropping guard' or 'going easy' weaknesses.
With such a large AP advantage and similar enough hacks and speed to keep up, I'd say Goku wins via the K.O.