The most important factor by far for suitability for climbing hills is how low the gear ratio is. The weight is also a factor, but a much more minor one.
If the lowest gear is the same, there's not much in it as to whether a mountain bike (fatter tyres, front and possibly rear suspension, straight bars, stronger frame) or a "road bike" ( thinner tyres, lighter frame, drop bars) would be better - probably the road bike would actually be better because it's lighter and the tyres produce less resistance.
BUT: the lowest gear is unlikely to be the same. Mountain bikes are designed for going up, err, mountains, so have low gears. Road bikes are designed for people who fancy themselves as mega fit and eschew low gears, so tend not to have sensibly low gears. Any off the peg road bike will almost certainly not have terribly low gears, which is why a mountain bike would be better for comfortable cycling up hills on roads than a road bike.
You can, of course, have a "road bike" - lightweight frame, low resistance tyres, no suspension, drop bars - with sensibly low gears. It's called a touring bike.
[apologies for edit - I hit "post" by mistake too soon]
[edited again to say, Pale Rider beat me to it, rather more succinctly]