resistence of tires/dirt, to geometry of the bike and riding position to gearing, MTBiking is harder and you will need more kw to pedal the same grade of trail/road.
Here's a good article that breaks it down so we don't have to rely on your subjective experience:
A road bicycle is 10 to 30% faster than a mountain bike and is 15% faster on average at the same power output on smooth, paved surfaces. Riding posture, rolling resistance, frame geometry, and weight are the main reasons for road bikes being faster with the same level of effort.
https://pedalchile.com/blog/road-vs-mtb