As seen from the news reports and the video of the incident circulating online, most of the people were standing away from the tracks. It was only when the effigy started burning that many of them backed away on to the tracks and were hit by the oncoming train.
Even then, it was only isolated patches of people that moved on to the tracks, not a dense mob.
The line man would not have had any time to warn the oncoming driver about the people on the tracks, as they moved rather...
more... suddenly after the effigy started burning. Similarly, the driver would not have been too concerned as he would only see small batches of people on the tracks, and not a large stationary mob.