Consider, too, that the diesel engines in large locomotives are basically rolling power plants. The diesel fuel doesn't directly power the drive train; it's used to generate electricity to power its electric motors.
One of the major reasons for these trucks and the locomotives having electric motors, is that maximum torque is available from 0 rpm in an electric motor. A diesel or petrol engine will max torque further up it's power band. This means these large machines are much easier to get moving.