Neither, ever, for anyone. If it's really the same power output or effort, exhaustion will come at the same time regardless of what one is doing.
I will say, however, that it can be a challenge to maintain a lower level of effort going up hill. When on flats, one can from time to time drop to zero effort with no perceived ill effect. That's nearly impossible on inclines, so exhaustion may come sooner, as a matter of time, simply because the effort uphill is unrelieved, while on the flats, there may be a bit of soft pedaling, if not coasting from time to time (averaging out to the same level of effort exerted at a constant rate uphill) - and even fractions of seconds of such relief can accumulate make a difference.