The equation you should start off with is (a^2)+(b^2)=(c^2). The a is 240 and the b is 320. Use Pythagorean Theorem to solve for what c is. Then take the derivative of the equation. You should get 2aa'+2bb'=2cc'. a' and b' are both -164 since the distance is decreasing at that rate as they approach the station. Plug in your numbers and solve for c' to get the rate that the distance between the two trains is changing.