Same HR, same power output and cadence, same amount of time?
Would be the same if you did it on a Peloton
IF the goal is to become a better cyclist, or stronger in a specific cycling discipline, then pick the bike best suited to the kind of riding you're going to be doing.
If you're just going riding as a non-specific form of excercise, then pick a middle-of-the-road kind of bike ( hybrid, gravel, that sort of thing). High-performance bikes, whether on or off-road require a lot more compromises by the rider, when you're using them outside the discipline they were designed for