Hmm, it's a tough question. Let's see.
Mario has:
~Mushrooms that give him varying powers.
~Fire Flower, Super Mario Feather, and the Raccoon suit.
~He can become a giant.
~He's fought off Bowser, a giant dino-turtle countless times.
~Has been a doctor, super hero, Kart racer, and played every sport ever.
~Yoshi, his companion throughout the ages.
Mario doesn't have:
~Any true "Ultimate Form".
~Any real "rivals" to compete with. Face it, Wario doesn't count.
~Is a short stubby plumber (most of the time).
~Any real goals aside from "Save the princess".
~Any real way to fight without power ups, save for jumping on enemies.
Sonic has:
~Super Sonic, his ultimate form which allows him to fly through space at (pardon the pun) super sonic speeds.
~An awesome design. He's blue, spiky, and wears some bad-ass shoes.
~Fought off enemies with a sword (Sonic and the Black Knight WAS a pretty decent game).
~He has a real rival who is, to be honest, even more superior, Shadow the Hedgehog.
~Has clever comments and witty retorts.
~Taken down NUMEROUS different enemies, in addition to Eggman (like a giant satellite lizard thing, for instance).
~Can run fast enough that he can run on water.
~Doesn't need any "power ups" to use his spin attacks, or jump incredibly high.
~The Chaos Emeralds, which give him insane abilities, such as Chaos Control (Sonic did perform this in SAB2, though he did have some luck).
~The rings which keep him nigh invincible, so long as he has one.
Sonic doesn't have:
~Any means to swim. Once he's in water, he's gotta jump/run his way before drowning.
~Brains. Yes, he's incredibly courageous and heroic, but he rarely uses his head before he acts.
~Experience in various things, such as being a doctor or super hero (with a cape). He's a super-fast hedgehog, plain and simple.
~The courage to face Amy. Face it, he's a coward when it comes to her.
If I missed anything, I apologize. But I think Sonic can run circles around Mario any day of the week. Sonic just has far too much going for him, and greater fighting capabilities. Sonic could beat the biggest, baddest enemy Mario has ever faced, but could Mario really beat the Dark Queen while flying through the Void itself? With a Fire Flower? I think not.