Railway security guards rushed to save the toddler after they spotted him playing on the line - with a locomotive seconds away