Excellent advice above.
My question is, where do you ride?
it is a matter of efficiency. A mountain bike has a lot of heavy MTB-specific design elements---even with a rigid fork,. They are simply not designed to do anything so well as bask over rocks and roots, short bursts of high-intensity pedaling and frequent direction changes on sketchy surfaces.
If that's not the type of riding you do ... you a re driving a jacked-up four-wheel-drive pickup with full rollbars and a winch, two-foot tires and rock-crawler gearing on the highway. Obviously it won't work as well as a sports car or even a family sedan.
If your focus is riding on the road, And you can afford another bike, then ... well obviously. If you like a mix of on- and off-road, Then look at gravel-bikes of "cyclocross" bikes----or, have two bikes, which makes a lot more sense. (Each should be much better at its intended use.)
A road bike will gain you a little speed through aero and weight, and probably more efficient tires---but don't expect a lot. I can run the same short route on my skinny-tire CF Wunderbike and my ancient fat-rubber touring bike which weighs easily twice as much and gain maybe a few tenths, of half a mile-per-hour on a good day.
The rider is what makes a bike fast. If you keep pushing on the bike you have (if, for some reason, you couldn't get the bike you want right away) your effort will not be wasted.