When you are just parking your vehicle somewhere near a railroad crossing and not just waiting on a train you must park your vehicle at least 15 feet away from the railroad crossing or train tracks.
If you're driving down the road and come upon a railroad crossing and a train is about to cross the railroad tracks you must stop within 50 feet of the railroad crossing but no less than 15 feet.
I see some drivers parking as close as 10 feet to the railroad crossing which is not safe in the event the train throws something out while going down the tracks.
The farther away you can stop or park from the railroad crossing the better but do not park or stop closer than about 15 feet for safety reasons.