Very fine question Benito and I have no problem answering such and relate reality with fiction as in the film. OK....First of all, the in the beginning of the film when the engineer jumps off the train in an attempt to stop it, they should be rolling the credits of the movie then. In reality, locomotives are big air compressors that give air through the entire train. Brakes are applied on a train after the air on them exhausts through the main reservoir each car. Since the cars were not coupled to the locomotives' air (the scene in the movie where the guy tries to couple the cars but fails), all the brakeman had to do was "blow" the air from the locomotives to apply the brakes on them to stop the train. Scenario 2: Remember in the film, when the switch engines hop in front of the runaway train, and try to stop it with the locomotives itself? Why, in this scenario, would not a crewmember be on the rear end of the engine consist, and the switcher matches the speed with the runaway, the crewmember jumps from the switcher nose to the runaway nose and manually stop the train? As you can see, this comparison goes on in the entire movie. I won't even begin to tell you about how fake the scene is with the train making it through the elevated curve grabbing the independant brake....And that was fake too. When Denzel was telling him to use more independant, Chris Pine was using the "big air". Remember in the beginning of the movie, the train had no big air!!!! lmbo!!! (Big Air is railroad lingo for air pressure through the entire train and Independant is braking for only the locomotives). As for the "derailer" I've never seen a derailer like the one used in the movie and I'm not saying thats fiction. But derailers do work, and I don't think you would want to be close to a chemical train when its thrown off the tracks as you saw in the movie.
Also, the penalties for the engineer leaving the cab are serious if he is at fault of a incident, but if you look up BNSF Crash on youtube, you'll see the penalties of reality after being at fault of a incident. (If you look it up, pay attention to the left side of the oncoming train). And remember, no train ever goes under power on its own...If its under power, its manual, and after so long without touching the throttle, there is a safety feature that stops the train when a alert is given and it is not acknowleged after a certain time...(usually like 30 seconds).
This is pretty much, but I hope this clears answers your questions for you.