The lengths of the trains don't matter since, whether they cross each other traveling the same direction or the opposite direction, the total distance that must be traveled is the same.
When the trains go in opposite directions, the total combined distance they need to go is the total length of the two trains.
When they go the same direction, the faster train must pass the slower one by the total length of the two trains.
Thus, since the travel distance is the same in either direction, we can completely ignore the information that the lengths of the two trains are in a 2:3 ratio.
When the trains are passing in opposite directions, the speed at which they pass is slower + faster.
When they are traveling in the same direction, the speed at which the faster passes the slower train is faster - slower
So, given that they need to travel the same distance either way and that the ratio of the time they need to pass in the same direction to the time they need to pass in the opposite direction is 4:1, we have the following:
Rate x Time = Distance
D = the distance either way
Rate when going the same direction = faster - slower
Rate when going opposite directions = faster + slower
Time to pass going the same direction = 4T
Time to pass going in opposite directions = T
(faster - slower) * 4T = D
(faster + slower) * T = D
(faster - slower) * 4T = (faster + slower) * T
(faster - slower) * 4 = (slower + faster)
4faster - 4slower = slower + faster
3faster = 5slower
faster/slower = 5/3
The correct answer is (B).