Top speeds of locomotives varied due to different variables...
Steam engines, in a nutshell, were captive to the size of their drivers; a 4-8-2 with 69 inch drivers had different performance characteristics than a 4-8-2 with 73 inch drivers. Not sure about how "they" determined a steam engine's maximum speed; but generally from what I've read, the track speed was ALOT less than what the steam engine could run ... leading to some very fast (illegal) runs in the good old days. The size of the drivers dictated the speed a steam engine ran most efficiently, so railroads really focused on the engine's "primary duty" when choosing which drivers to use.
Diesel engines had a "max" as well as a "minimum" speed; determined by the gear ratio of the traction motor/axle. Most freight units had a "minimum continous speed", that's using full power, of 11 MPH, which means a "max" speed of 65 MPH. Passenger units had a "higher" ratio, since there was seldom a need to run full power at 11 MPH, but they needed a higher "top end" speed, around 100 MPH. AC traction locomotives don't have a minimum speed, but still have a maximum.
For example, the following specifications applied on two common EMD units offered:
SD40-2 (freight), 40 inch diameter wheels:
Gear ratio of 62:15, min speed of 11.2 MPH / max speed 65 MPH
61:16, 12/70
60:17, 13/76
59:18, 14/82
F40 (passenger), 40 inch wheels:
Gear ratio of 57:20, min 16.3 MPH, max 103 MPH
Determining min/max speeds would require railroad-specific research, based upon what options the railroad ordered for a specific model locomotive. I recall finding a "diesel locomotive specifications" website last year that showed the various gear ratios available (which determined min/max speeds), but I can't remember where it was. If I find it again, I'll post the link.