Before the advent of automated level crossing gates, and still where automatic gates are not installed, flagmen were also assigned to protect the crossings. The flagman would stop road traffic from crossing the tracks as trains used the crossing.
en