Notice the following 2 screenshots (taken at night to show the headlight):
In the second case, if I press right while the train is moving, I switch right at the intersection if I'm also pressing forwards (accelerating). If I am not accelerating, the train goes straight (and turns left if it finds such intersection).
I believe that while this is the intended behaviour for train cars, it's not for locomotives.
EDIT: Thanks Jap2.0 for the spoiler fix.