Think about this question in terms of "what is changing" (or what is the variable in the equation). The question mentions the starting location (which is constant), the speed of the trains (which are constant), and time (which changes). Since time is changing the same for both trains (because it changes the same for everyone everywhere) you can just pick a single variable for it... lets call it T for time. Now we can write an equation.
We want to know when sum the distance traveled is equal to 290, and we know that distance is speed multiplied by time. How do we know this? Because speed is measuered in Kilometers per hour... "per" means "divided by," so we can see that speed is literally "distance divided by time". If speed is distance divided by time, then (distance/time)×time=distance.
So if we want (Distance 1) + (Distance 2) = (Total Distance). then we can write our equation as--
(Speed of train 1)×T + (Speed of train 2)×T = (Distance they traveled apart from each other)
--and then we can just solve for T!
I hope this helps!