Switchback
(1997)

Bob Goodall (Danny Glover) is the killer. He has been tagging along with med school dropout Lane Dixon (Jared Leto) in an effort to plant evidence that Dixon is actually the killer, kill him, then continue on undetected.  His battle of wits comes to head with FBI agent Frank LaCrosse (Dennis Quaid) on a train.

LaCrosse first believes Dixon is the killer as the evidence points that way but soon figures out Goodall is the real culprit. They fight on top of the train until Goodall tries to escape by jumping off and falling down a ravine. This backfires on him in a just manner as he winds up being impaled on a tree branch and dying. LaCrosse is angry that Goodall is dead as he was the only one who knew where his kidnapped son is, but Dixon remembers a key fact Goodall once told him. 

LaCrosse uses the information to track down the location and is reunited with his son.  

Thanks Spectre!