car traveling on a road perpendicular to railroad track, car is 30 meters from the crossing, train is 50 meters from the car; how far is the train from the crossing?

You have a right triangle situation and the car-train distance is the hypotenuse.

The other leg of the triangle is sqrt[(50^2 - (30)^2]