It is much slower than your road bike? Well, that's odd. Physically speaking, the machines are very similar.
First, your riding position may be a bit off on the MTB because it is necessarily a smaller frame. Try adjusting your seat for "crease support" whereby the edges of the seat would contact the seams of "brief" underwear. You'll need to sit well far back on the seat. You'll need to have the seat far back on its rails (as far as it will go). You'll need to have the seat now high enough that if you really mash the pedals that you lift up off the seat by about 2mm. You can't see this clearance, but you can feel it. Normal pace riding should result with full leg extension while you're on the seat. Correct any misfit by adjusting or replacing the handlebars. Small frames (all MTB) have small headtubes. This usually makes the handlebars a whopping 4 inches too short. Be prepared for a small frame to have a ridiculously long stem or handlebars that look like an albatross to make up for the size difference.
Not riding down "falling down" over the front of the bike can make a huge speed difference by making the front tire perform less work.
After adjustment, ride it and grip over the brake mounts so that your body is in the same position as the road bike. I wouldn't recommend riding this way unless there's a lot of wind. See if you gain about 4 miles per hour.
There's one sure thing to cause slowness:
Riding in the 11 or 12 rear sprocket because the largest front chainring has only 44 teeth, and in this case, you'll need a 52 tooth large chainring or higher.
This 44x12 combo is going to "bind" your chain just a bit and create a rather awful slow sensation. You need a big enough chainring (front) that you can ride in the 14 tooth and larger rear sprockets at the speed you wish to go.
In fact, the 14 tooth rear sprocket can also bind your chain, but you can usually adjust the derailer clearance to smooth it out. Smaller sprockets are for downhill riding.
You can try adjusting your wheel forwards or backwards. . .probably as far forwards as you can get and still have the wheel on straight.
To make it worse, most MTB derailers don't have the "B" screw (Shimano) or the "A" screw (Campy). So, the only way to adjust the clearance angle is to move the wheel about. There is no correct angle for the rear derailer, but you may have it "favor" the high gears or "favor" the low gears. This adjustment is usually good for about 7 miles per hour gain if you "favor" the high (tiny rear sprocket) gears by giving it enough clearance that it won't bind the chain.
Oil your chain with lightweight car motor oil. Shift into your highest gear and oil the chain where it bends across the smallest rear sprocket. This will put the oil INTO the chain. Anywhere else will simply put the oil on top of the chain where it will immediately come off onto your pants. Have your bike tipped towards you so that you don't oil the tire.
Middleweight tires are from 1.5 through 1.8 sizes:
These are known to have problems pacing a high speed. They are for only one purpose and that is gravel roads (slow loaded touring). They aren't large enough to "float" over road bumps, so there is no speed advantage from smooth rolling. They aren't small enough to rise the majority of their tread above the surface like a road bike tire, thus gaining an advantage through small contact. In fact, there is no advantage to middleweight tires. Middleweight slick tires are even worse than knobbies because 100% of the soft, gummy rubber is making contact with the road.
So, I would state that if your chain isn't binding over the rear sprocket and if your front chainring has more than 50 teeth, then the cause of slowness is the tire.
Most troublesome is the front tire. Middleweight and larger tires need far less air in the front tire if you have an upright riding position. You can get tire speed from flexability (touring application: you will be struck by a bump, so make it a soft bump) or from minimal contact patch (Road application: you will be struck by a bump, so make it a small bump).
It is also completely acceptable to run unmatched tires. This can be tire size or inflation.
Try 40 pounds of air in that front tire, and certainly no more than 50 unless you have drop handlebars.
If the tire gets even slower, replace it with something that is not so sticky (gummy, "slick" rubber=slow).
Try a 1.0 (if you have small rims) or 1.25 - 1.3 (MTB rims) racing tire (tread has almost no effect) on the back wheel. Since it isn't responsible for steering, there's no safety problem with a small back tire.
It is certainly not the wheel size that affects bike speed. Recumbents fly past on little 24" wheels. 😉
I'm currently testing out the Tom Ritchey 1.4 to see if it can do both touring and road well or if it does neither job well just like the 1.5 through 1.8 sizes.
I've been experimenting with tire sizes for a while now.
1.9 and higher sizes with relatively smooth tread (smooth to the touch with visable tread) are like riding velvet tires over glass. These are Schwinn Typhoon and Schwable Big Apple beach cruiser tires. While a tiny bit more effort to pace in the 20 MPH range, the very hard (hard rubber, not sticky!) tread, 3/4" contact point and flexability makes for a fast ride with zero bumps. Offroad is equally pleasant. The problem? These (with 40 front, 60 rear) make the bike impossible to sit on at the stoplight.
Above all avoid non knobby "running stripe" tires. While a bald or slightly smoother center makes knobbies fly (because they're still flexable), the technology does not work for high inflation road tires. Without tread, the tire cannot compress over the minute road bumps and the result is like riding with the brakes on. A new technology, "reversed tread" supposedly addresses this issue, but I haven't purchased any to test them.
Yeah, there's a lot of guesswork on the tires, and I haven't found out why the middle ranges don't work well. But, those are made for loaded touring and they do not pace well.