Mario 3 and World are

, but there's a good argument that Sonic 2 and Sonic 3+Knuckles are better as well.
I can still play Mario 3 today and find new secrets and pull off crazy mess I never knew was possible. Coin ships, White Toad Houses, secret passages, all the suits you got, and even really obscure stuff like that ONE fortress miniboss you can actually kill with a star if you're fast enough.

I grew up as a Nintendo kid, so I gotta roll with Mario, but the Sonic games are still
Knuckles
Mario 3, Yoshi's Island and Sonic 3 and Knuckles >>>> Sonic 2, Sonic CD, and Super Mario World
I would rank them as:
I consider 3 better than World, tbh.
The suits were >
the worlds were >
the tighter level design was >
the giant boot was >
the challenge was >
and you couldn't cheese your way over the whole game with a blue yoshi or a

World is still piff thanks to hidden exits and alternate paths, different colored Yoshi's, and the secret hidden world at the end
In general, Sonic has the better music and bosses, while Mario has the doper powerups, secrets, and puzzles IMO
3D Mario >>>>> 3D Sonic, but Sonic >>>>>> Mario when it comes to other media that isn't video game related (comics, cartoons, anime, etc)