Question 281399
Lets consider the distance of train from crossing is 'a' meters

distance of car from crossing is given, say , 'b'=30 meters
distance of car from train is given, say , 'c'=50 meters

Also the rail track and road are perpendicular to each other so it makes a right anlged triangle between car, train and crossing.

now we know that in a right angled triagle a^2 + b^2 = c^2
replacing the values we get

a^2 + 30^2 = 50^2

a^2 + 900 = 2500

a^2 = 2500 - 900

a^2 = 1600

a = 40 meters  

so the distance of train from crossing is 40 meters