How fast a bicycle goes is determined by the combination of the overall gearing ratio and the ability of the rider.
For a given gear, a bicycle can only move a certain distance down the road for each turn of the pedals.
So on any bicycle, the faster you can turn the pedals - in that gear - the faster the bike will go.
Unless you’ve specially trained for it, you probably can’t pedal efficiently above 100 rpm.
On a normally configured 26” MTB, this means you’ll ”spin out” - not be able to move your legs any faster at about 25 mph/40 kmh.
A hybrid or drop bar bicycle/road bike is likely - but not guaranteed - to be faster b/c of a higher gearing ratio. It might spin out at 35 mph or so. Keep in mind that a higher gearing ratio ALSO makes the pedals harder to turn, so it’ll take more strength to spin out.
More gears generally don’t mean a higher top speed. The rider being the limit, most (comparable) bicycles have had very similar top gears for decades.