It is stated in the traffic rules that you may not stop (and consequently also park) less than 5 metres from a level crossing.