Sonic's speed makes Batman's gadgets and tactics irrelevant — you can't prep for lightspeed.
Batman's prep time is legendary, but Sonic's speed operates at a tier where preparation is meaningless. By the time Batman reaches for a batarang, Sonic has circled the Earth twice.
Even with specific anti-speedster tech, Sonic's lightspeed movement makes catching or targeting him virtually impossible with human-tier technology. The Speed Force equivalent in Sonic's universe puts him in the same speed tier as Flash.
Batman has fought speedsters before and has anti-speed technology. His tactical mind could set traps. Sonic's overconfidence is exploitable.
Sonic is approaching lightspeed. Batman is peak human. The speed differential makes this a non-contest regardless of gadgets.
Sonic wins through overwhelming speed. Batman's prep-time powers don't help against something this fast without Justice League-tier resources.
Batman also fights
Sonic the Hedgehog also fights