.
Time they travel before they cross each other is = 10 hours.
During 10 hours the first train covers 10*20 = 200 km.
Answer. 200 km.
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
The tutor "MathTherapy" wrote his own solution.
Probably, he tried to prove that I made a mistake in my solution.
But instead, he made a mistake in his own solution.
Below I re-wrote his solution with my correction. It gives the same result/answer as my original solution.
------------------------------
With D being the distance from X where they cross, we get the following TIME equation:
30D = 20(500 - D) ------- Cross-multiplying
30D = 10,000 - 20D
30D + 20D = 10,000
50D = 10,000
D, or distance form X where they cross =