There are at least four factors involved:
1. Tire pressure
The thinner the tire, the higher pressure it requires, and the higher pressures it can handle. More pressure means less deformation, and less deformation means less energy loss. Road bikes typically have very thin tires that allow pressures around 10bar, if I'm not much mistaken (you can look that up on the side of any tire), touring style tires are around 5bar, mountain bike tires even lower.
2. Tire geometry
The diameter of your wheel also plays a role: With a smaller wheel diameter, you get a shorter contact area with the road. That's simple geometry. Because the total area of the contact only depends on tire pressure, a shorter contact area means that it's wider. And a wider contact area means deeper compression of the tire, which again means more work that's expended for massaging the rubber.
3. Posture (aerodynamic)
At 25km/h, the strongest force holding you back is the air drag. And the more upright you sit on your bike, the more air you are accelerating as you pass by. Road bikes typically have a low bend sitting position because they are designed to be ridden at much higher speeds where air resistance is an even greater concern.
4. Posture (ergonomic)
To put your full weight onto your pedals, your center of mass has to be over the front part of the pedaling circle. With an upright sitting position that's generally not the case. The result is that some of your pedaling forces are translated into forces that try to rotate your body and to shift it backwards, which you have to compensate with your arms and butt.
The forward-bent position of a road bike does a much better job at putting your center of mass where you need it, and thus reduces the parasitic forces, allowing you to just use your strength to turn the cranks. This translates into more power output with the same subjective effort.