I don't believe the train keeps chasing you, it'll stop and return to its starting position once you get far enough away (or else you could simply try for a loop around it) - IIRC, it's the junction back to the snow realm or north. It basically just patrols that one stretch in defiance of all other Dark Train logic in order to be a roadblock. (I'd forgotten about it, honestly, and thought it was a rockfall or something that blocked the path.)