An actual train queastion. And here I thought they were just a tv trope.

Train 1 distance from station is 60t Where t=0 at 10

Train 2 distance from station is 45-45t

Pythagorean theorem gives us the distance between trains:

sqrt ((60t)^2 + (45-45t)^2)

The square root has a minimum at the same time as its contents so we can ignore its leaves us with finding the minimum of

5625t^2 - 4050T +2025

Differentiating to find the minimum gives us

11250t - 4050 = 0 or t=.36

Multiply by 60 to get 21.6 minutes after 10