When I think about Mario vs. Sonic, I like to think about it in a gameplay way instead of a “lore” way. Like, if you dropped a standard in-game version of Mario and an in-game version of Sonic in an arena and let them PvP each other, who wins?
It’s pretty much always stacked in Sonic’s favor, since he has a stranglehold on the neutral and an instantaneous Homing Attack. Mario has absolutely no way to approach Sonic, so he has to find a way to counter him from where he stands.
Assuming Mario gets to bring in a “standard” powerup, he could try to counter a Homing Attack with something like a raccoon tail swipe, a cat claw slash, a Fire Mario fireball ect, which could work against many incarnations of Sonic who have to attack at close range. It’d require an inhuman reaction time from Mario, but it’s theoretically possible.
But, if Sonic is Frontiers Sonic, he doesn’t have to approach. He can spam projectiles, or run around Mario to Cyloop him. Mario is going to have to use a projectile, and that projectile is going to need to one-shot, since Frontiers Sonic can generate Rings infinitely by Cylooping nothing. If it’s Odyssey Mario, Cappy would have a realistic possibility of hitting and possessing Sonic due to the homing feature Cappy has when you shake the Joycon, and, if there’s any bottomless pits in the arena, Mario could drop Sonic into said pit. Sonic, however, can easily counter this by picking any cosmetic skin that has a hat (the party hat and sunglasses, the Santa costume, either version of the Rathalos armor, or the 100% completion crown.)