Yes, a runaway could, and did start in the way described in the movie.
The script for "Unstoppable" is loosely (very loosely) based on an incident that occurred in CSX's Stanley Yard, Walbridge, OH on May 15, 2001. The engineer of SSD-45-2 No. 8888 (think 777 in the movie) left his cab to throw a trailing point switch. Before dismounting, he erroneously thought he had set the unit in dynamic braking mode and set the throttle to run 8. The train air had not bee hooked up while switching, but the engineer applied his independent (i.e locomotive) brakes to slow his 47 car train. After throwing the trailing point switch, the engineer was unable to remount and slipped and fell. His train accelerated out through the yard and out on the main without anyone aboard.
The railroad tried several strategies to stop the runaway. Incidents in the movie involving derailers, and the decision to try and shoot at the fuel cutoff are real. Both were unsuccessful. In the end, CSX dispatchers lined up another locomotive that went out behind the runaway - caught up with it...coupled...and slowed it down to 10 mph a speed. At that speed, a Trainmaster was able to hop on at a grade crossing and shut the unit down.
Obviously the rollover, the antics showing Denzel running along the tops of the cars...and the near derailment on a curved bridge are just Hollywood "additions" to make the movie more entertaining. The "real thing" ended with a wimper - not a bang.