My first guess was that it was shot in reverse, but the steam coming out of the stack suggests otherwise. Is it that the camera was on a dolly that the train pushed along upon contact?
@BennyTheIcepick I would guess there would be a jolt when the train finally made contact, but it wouldn't be too hard for Keaton to sit super still and then immediately splice to a new shot of him twisting his head.
@stereoplex I was thinking the same about their being a jolt, and the two-shots-spliced sounded possible, but I'll be damned if I can see it, even frame-by-frame. Between frame 40 and 41 (the last frame before the locomotive stops moving relative to our POV, and the one where it does "stop") his head does move slightly, but that's the beginning of the movement that continues for the next few frames. Literally everything else remains unchanged though – shadow angle, position of his fingers, creases in his pants, jacket and shirt – which I cannot see being true if there was a splice. So this is a long way of me saying I don't know how he did it, either.
That man really earns the title of magician.
But it sounds like @qualiall has the lowdown?