A freight train going in one direction takes 3 minutes to pass a crossing. A slower train of the same length on a parallel track in the other direction takes 4 minutes.
How long does it take these trains to pass each other?
If they start head to head (on parallel tracks) then they will be alongside each other (head to foot, engine to caboose) when the faster train has traveled 4/7 of its length and the slower train has traveled 3/7 of its length. This takes 3 minutes * 4/7 = 4 minutes * 3/7 = 12/7 minutes. Double this to get the time at which they will have passed each other (caboose to caboose).
Final answer = 24/7 = 3 3/7 minutes.