The engineer is expelling steam through valves at the bottom of the piston cylinders. This allows any condensed water in the cylinders to be expelled with the steam. This is usually done when the engine begins to move. It's a judgment call by the engineer as to when the cocks are closed, but it's usually within a few moments after the train begins to move.
A continuously growing album of photos that IMHO reveal the awesome and seldom-seen beauty of the railroad world from the dimming of day to dawn's early light! From dusk to dawn, trains roll on! (I'm still finding gems of sunset-to-sunrise surprises!)