Jack is right on the money with his comments about the setting of the cutoff. That is absolutely critical to the proper handling of a steam locomotive at high speed.
When entering these discussions of speed, you must remember that when you get to REALLY high speeds (over 80 mph) the cutoff is set VERY short. The steam admission port is only open for a very small percentage of the piston stroke, on the order of 20% or even slightly less. However, the throttle is likely wide open in this scenario, providing a wonderful draft for the fire and very high superheat temperatures. A good fireman can easily supply enough steam to take the locomotive to "rod-throwing" speeds...
IF the engineer has the cutoff set right.
A steam locomotive is much more likely to be run out of steam on a long, hard pull on a grade at 30-40 mph than it is at 80+ mph. If the engineer sets the cutoff too long in this scenario, the engine is actually using more steam at 40 mph than it is at 80 mph. It's not using it efficiently, but it is using it nonetheless. I could run the 765 out of steam at 30 mph if I wanted to, by leaving the reverse down in the corner at full cutoff and running the throttle wide open. Of course, if I did that, I would likely be banned from the cab forever and hung in effigy by the entire cadre of firemen!
I once fired the 765 in this exact scenario. We had about 30 freight cars and the engineer was running the engine hard. (It was not one of our regular guys at the throttle.) At 30 mph I had the water pump almost wide open, crowding the fire as much as I could and was slowly losing ground on both the water and the steam. When pressure slowly dropped to 210, I knew something was wrong. I finally realized that the engineer had the throttle wide open and the power reverse still full down in the corner. The railfans would have loved it because the 765 was making a deafening racket. It was without a doubt the worst I have ever seen the 765 run. When I realized what was going on, I went over to the right side of the cab, reached in front of the engineer and placed the reverse lever where it belonged. The engine immediately quieted down a little and began to accelerate. I had a brief discussion with the engineer about what the definition of a "hard pull" was and then went back to my seat on the left side. I had already gained back 15 pounds of steam and all was right with the world again.