Step 1: Set up the lengths of the two trains.
Let the speed of the first train be \(a\) m/s and the speed of the second train be \(b\) m/s.
When a train crosses a man standing still, it covers a distance equal to its own length in that time. So the length of the first train is \(25a\) and the length of the second train is \(15b\).
Step 2: Write the equation for the trains crossing each other.
When two trains move toward each other, their relative speed is the sum of their speeds, \(a+b\), and together they must cover the sum of both lengths.
\[ \frac{25a + 15b}{a+b} = 21 \]
Step 3: Solve the equation.
Multiply both sides by \(a+b\).
\[ 25a + 15b = 21a + 21b \]
Bring like terms together.
\[ 25a - 21a = 21b - 15b \]
\[ 4a = 6b \]
Step 4: Find the ratio.
Dividing both sides by \(4b\), we get \(\frac{a}{b} = \frac{6}{4} = \frac{3}{2}\).
So the ratio of the speeds is 3 : 2.
None of the other ratios, 21:10, 1:2 or 5:3, satisfy the equation \(4a=6b\) when checked, so they are incorrect.
Final Answer:
The ratio of the speeds of the two trains is 3 : 2.
\[ \boxed{a:b = 3:2} \]