These videos may help:
GTA V Online - How to enter / steal the Train Cab / Engine on ALL 5 Systems, AFTER the Update!
GTA V: Train Hijacking
GTA5 HOW TO GET INSIDE THE TRAIN!! (GTA 5 Ride Train)
GTA 5 - Evade Ep24 - Hijacking a Train!!
Thank you for willing to help answering this question!
Replies that are not useful can be deleted by moderators!
The thing is, that you can't stop or drive a train without mods. There is no other way, so you need a PC version of a game and a modification called "Engineer Railway". You will also need a Script Hook and ASI Loader for this mod to work.
There is only one place and time, where you can officially drive a train - it is a single player mission with Trevor, called Derailed. It is a very fun part, where at first place you need to get on the train riding a bike, hijack it and at the end there is a massive crash.