The REAL Ending (according to the book)
After reading the book, I thought I'd share what really happened at the end...
The entire robbery was actually a success. Pierce leaves the train station with no real problems. After the heist, Pierce keeps (and then hides) the gold and instructs the "gang" that the money will be divided up in 2 years. A year and a half after the robbery, Agar's mistress gets busted for pick-pocketing and, in the process, tells the police that Agar was involved in the Great Train Robbery. At this time, Agar is in prison for counterfeiting fake money. The police question Agar until he finally caves in, telling them that Pierce was the mastermind and where he lives. Pierce and Burgess are then arrested. Pierce serves a few months in prison before the trial, where he confesses. After the trial, Pierce is put in a van to be taken back to prison. Barlow intercepts the van and he and Pierce knock out the guards, drop them off in a ditch, and steal the van. Pierce, Barlow, and Miriam are never seen or heard from again. Agar is exiled to Australia, Burgess dies in prison, and they money is never recovered (presumably split up between Pierce, Barlow, and Miriam).