Every train problem uses the ordinary relation time = distance ÷ speed. What makes these questions feel different is that a train is long. The front of the train has to travel further than the gap between two points before the whole train is clear, and the extra distance is exactly the train's own length.
So the only real decision in a train question is which distance to use. Once you have that and a speed in matching units, the arithmetic is a single division. This page sets out the four cases you will meet, then shows how to work backwards from times to lengths and speeds.