Veteran Allegheny and West Virginia Railroad (AWVR) engineer Frank Barnes (Denzel Washington) oversees his co-worker, freshly hired conductor Will Colson (Chris Pine) as they use AWVR locomotive #1206 to pick up several train cars outside Stanton, Pennsylvania. Will picks up five cars too many, which they realize only after they have left the train yard. Although Will demands that they roll back and uncouple the extra cars, Frank continues north on the main line with the extras in tow.
Meanwhile, in a rail yard within the northern town of Fuller, two AWVR hostlers, Dewey (Ethan Suplee) and Gilleece (T.J. Miller), are ordered to move a freight train led by locomotive #777 (nicknamed "Triple Seven") off its current track to clear the track for an excursion train carrying schoolchildren. Dewey attempts to take shortcuts, instructing Gilleece to leave the hoses for the air brakes disconnected for the short trip. Dewey later leaves the moving cab to throw a misaligned rail switch along the train's path, but is unable to climb back on. He is forced to report the train as a "coaster" to Fuller yardmaster Connie Hooper (Rosario Dawson). Connie orders Dewey, Gilleece, and lead welder Ned Oldham (Lew Temple), to intercept the train at a siding and board it. With no sign of the train at the siding, they come to realize that the train's controls have defaulted to full throttle, and it is speeding out of control on the main line.