Mind-numbing, to say the least

Anyway, here goes:
We're given a railway employee, standing on a platform, observes two trains travelling in opposite directions on parallel tracks.
Implication: The two trains will be going away from each other; one train going left in front of you will coincide on the parallel tracks with another train going right in front of you; they will both cover a certain distance at their respective speeds (with their RESPECTIVE lengths), and create a monumental challenge for us to calculate

Now, train 1 takes 40 seconds to completely pass the employee, while train 2 takes 25 seconds. Now, if the train that took 25 seconds to pass the employee was two carriages long and only travelling at, say, 20kmph, it would still be slower than, say, the 40-second train (taking longer) which, say, is 8 carriages long, and travelling at double the speed. That's why, the length, speed, distance are still variables, and we can't just calculate things right away.
To clear this logic more directly by assuming values: If a 200-meter-long shorter train travelling 10 meters per second parallel passes a kilometer-long train travelling at 20 meters per second, the longer train will cross the shorter train's front at second 0, cover the 200 meters length of the shorter train at the longer one's 20 meters-per-second pace, but we won't consider the two trains to have passed each other UNTIL the shorter train's made its way to the back of the longer train. However, for every 20 meters the faster / longer train is moving away from the shorter / slower train, the shorter train is moving 10 meters away from its counterpart. Hence, their combined speed here will reach 30m/s.
With all this information, we can form an equation and make our lives simpler.
What are the variables we are given? The variables which are constant to all? The TIME - 25s. 40s. 30s.
Let's use these.
Time = Distance / Speed
We know from the logic above that we need to combine the variables for both trains to answer the question--
Hence:
T(1) + T(2) =
D(1) + D(2)
--------------
S(1) + S(2)
(We further know that Distance = S*T)
HENCE:
=> 30 =
40*S(1) + 25*S(2)
---------------------
S(1) + S(2)
We move the denominator to the LHS.
=> 30S(1) + 30(S2) = 40S(1) + 25S(2)
(bringing like terms together --
=> 5(S1) = 10(S2)
That's a ratio of 1:2, which is the answer. -----
A railway employee is standing on a platform and observes two trains traveling in opposite directions on parallel tracks. He observes that the first train takes 40 seconds to completely pass the employee (from the moment the locomotive reaches him until the last carriage clears him), while the second takes 25 seconds to completely pass him. If the two trains take 30 seconds to completely pass each other (from the moment the fronts meet to the moment the rears separate), what is the ratio of the speed of the slower train to that of the faster train?
A. 1:4
B. 1:3
C. 1:2
D. 2:3
E. 3:4
Gift
12 Days of Christmas Competition
This question is part of our holiday event
Win $40,000 in prizes: courses, tests, and more