Yes, of course. I set the sustained power output to 200 W, so the total energy used will be a result of the total time and the sustained power.
But the issue here is that it doesn't even out!
With your reasoning, the rides should've used the same amount of energy and/or taken the same amount of time.
Here's the bit I'm referring to.
Now we're talking about something I actually understand--statistics. All of the factors Al mentions here are classified as error. They are random variances with a mean of zero, so they can be disregarded. For instance, on a long ride, you will go uphill, and then downhill, then uphill, then downhill. It all averages out in the end, so you don't even have to think about it. (In fact--if you start riding at home, and finish at home, you must ascend and descend equal distances. It is impossible to do otherwise.)
Contrary to what you stated, the average speed drops significantly, while the energy used goes up, for the same distance. That's why you can't exclude terrain from any reasonable energy calculator.
If you put the speed from the third example ride into one of those calorie calculators, you'll get a very different answer! In the case of the calculator previously linked to, it gives an estimate of 2900 kcal for ride #3. That's less than half of actual.
It overestimates the first example, giving 4700 kcal, while actual is 2640...