Road bike's Crank & Cassette on a MTB, what's the catch?
There are several things to consider:


Chain ring clearance to the frame, because a larger tooth count has a larger diameter. Since the chain stay is at an angle, and designed for a certain diameter, too large a ring will come too close to the frame. Anything closer than 5 mm, is not a good idea, since a larger chain ring will also flex more.
Maximum tooth count for front derailleur. A front derailleur is designed to work and shift well with a certain size of ring. There is usually a small range above that which can be used. (i.e. Shimano's 3x XT FD-M785 is designed for a 44t, but can accept up to 48t.)
Cable pull ratio for front shifter/Chainring spacing


There are special shifters designed to allow a road bike drive train to run with a flat bar brake and shifter. But there is no easy and guaranteed way to run a road crank set with a mountain bike drive train, unless you replace all of the drive train parts, and buy road touring flat bar shifters.

It is usually more cost effective to buy a road bike.