By Ridley, I assume you mean his organic form.
Gannon would win. He's got a trident, black magic, two double-bladed swords, and teleportation.
Bowser's fat, slow, weak, and can only breathe fire. His shell could easily be crushed by Ridley's tail or Gannon the hulking beast.
Ridley's fast, he can fly, he can drill with his tail, and breathes fire. However, he's big enough so that Gannon's black magic can hit him. Also, fast flying will never match teleportation.
Oh, and if you change Ridley to any other form, they're all metal (thus flammable), electrical (cutting a wire is instant death), and heavier, therefore slower and not as deft with flight.
HOWEVER, supposing Bowser was Giga Bowser, he would have higher chances of winning due to matching Gannon's size, approximate strength, and better defense. Thicker/tougher shell, bigger/stronger spikes, bigger claws, more fire, stronger fire, and larger mass, making him vulnerable, but he compensates for that with a tougher shell and more power. Gannon would still have black magic and weapons, but Bowser would get a better victory chance.
...OH! Fanboyism! I totally forgot! Bowser has black magic too! He can conjur hammers and turn things to stone! Read the SMB1 manual, he turned everyone but the Mario Bros and Peach to stone. He can't turn Ridley and Gannon to stone, but he can turn their weapons and attacks (minus Ridley's tail) to stone, thus significantly weakening them. And if Mario can break those stones, I'm pretty sure Bowser'll have no trouble decimating his geo-fied threats.