Considering a simpler case may be of use.
Imagine, instead of an escalator, a treadmill (yes, yes, I know. No airplanes, thankyouverymuch) tipped at an angle. Imagine this treadmill is completely frictionless, and starts at rest.
Now, imagine you step onto the treadmill at the top. What happens? Your weight will have a force component along the direction of the treadmill. This means your weight will accelerate the treadmill. By the time you get to the bottom, you will transferred energy, equal to mgh, to the treadmill. Transferring energy means doing work. This work goes into kinetic energy of the accelerating treadmill.
Now imagine you can run at lightning speed. As soon as you reach the bottom of the treadmill, you run to the top and ride down again. In this case, the total energy you’ve imparted to the system is 2mgh.
Now imagine your friend (who weighs the same) is a slow plodder. He steps onto the top of an unmoving treadmill. It starts to move downward. He immediately turns around and plods upward, but is never able to reach the top. In fact, he slowly drifts to the bottom, and steps off the bottom in exactly as much time as it took you to ride down once, zip to the top, and ride down a second time. How much energy did your buddy transfer to the system?
Well, he applied the same force for the same length of time–he must have accelerated the treadmill up to the same velocity…which means he imparted the same energy, 2mgh.
Don’t like the accelerating treadmill? OK the, imagine a magical device that keeps this treadmill going the same speed, no matter what, by adding or removing energy as needed (in real life, we call this magical device an “electric motor”). Everything above still applies: ride it down once and you’ve applied energy equal to mgh. Ride it down twice and you’ve applied energy equal to 2mgh. The magical device removes the extra energy as quick as you apply it.
More importantly, if you stay on it for the same length of time it takes to ride down it from top to bottom, you apply energy equal to mgh. It doesn’t matter if you stay put in one place, plod slowly upwards, or quickly climb so as to stay the same height above the ground. You still impart the same energy. In one case the energy ultimately comes from gravity, in the other it comes from your muscles.
Finally, note that if you climb the treadmill so as to stay the same height above the ground and your lazy buddy just rides from top to bottom without walking, you would have “walked” exactly the length of the treadmill in the time it takes your buddy to go from top to bottom. In otherwards, your muscles “feel” like you’ve climbed up to a height of h…because that’s the amount of energy they’ve expended.