A lot of the time it depends on how far the camera is from the object you are photographing. If something is moving left right perfectly parallel to the lens then generally the whole object will be blurred. Unless it's quite close to the lens...
But, for your train example, the front of the train is closer to your camera than the rest. So if you move your camera to track the middle of the train the front will be slightly blurred. If you track the front, the back will be slightly blurred. I could draw diagrams to show you why, but let's see if I can explain...
If you got someone to stand 10 meters from your camera and bounce a ball up and down think how far you'd have to move the camera to track it. Not much really. Now get them to stand a meter away and do the same thing. You'd have to move your camera a lot more. Next, think of them throwing that ball at you and over your head so and you have to keep tracking the ball. As it get's closer to you you would have to start move the camera faster to keep tracking the ball.
Well, this also happens for long moving objects, like the train for example. You don't have to move your camera as much to track the back of the object in comparison to the front if it is somewhat moving towards you. It kind of happens at a greater scale if the object is quite close and moving parallel to the camera. If you track the dead centre of the object, e.g. a car, it's quite possible that the front and rear or it will have motion blur but the centre will be almost perfectly in focus.
... if that makes sense...