20 ft. off the ground,miles of steel rail supporting it, thousand's of gallons of diesel, electrical equipment all around.
Safe. You are surrounded by metal which forms a pretty good Faraday cage. The loco is well grounded via the rails. Apart from the bang of thunder you might not even notice the lightning. The Diesel fuel is in a steel container under the loco and even better shielded than you are.