An automatic lock for mobile steps (15) employed to allow passengers to get on and off railway coaches, located in the lower bodywork of the coach and enclosed inside a casing (12) positioned below the bracket (13) of the fixed step (14), on the outer edge of which the mobile step (15) is hinged, and whereby said step (15) is activated by a connecting rod (18) to move from a lowered position to a raised position and visa versa. The other end of the connecting rod (18), opposite the pin coupling it to the step (15), is hinged to a carriage (19) equipped with bearings (20) which slide inside a shaped guide (21), activated by the stabilizer shaft (11) for opening / closing the railway coach doors, or by an independent unit (30), and thereby transforming the sliding of the carriage (19) into an angular movement of the step (15).