PSA: Stay at minimum 10ft/3m away from the edge of the rail ties to avoid being hit by a passing train. Trains can extend further out than the rail by almost a full metre.
Hey that's a fair question you pose. If you were to fall forward due to tripping, losing your balance from a gust of wind as the train passes or whatever, your head wouldn't be taken as a souvenir for the train.
And since I want this advice to gauge agnostic, and different areas will have different standards for maximum rolling stock dimensions, the buffer will account for almost anything someone would be likely to encounter at crossings.