The speed of the first train is calculated by dividing its length by the time taken to pass the pole, giving 150 divided by 15, which is 10 m/s, or 36 km/h. When two trains of the same length travel in opposite directions, their relative speed is the sum of their individual speeds, and the total distance covered to cross each other is 300 m. Since they pass each other in 12 seconds, their relative speed is 300 divided by 12, equaling 25 m/s. Converting the first train's speed to 10 m/s means the second train's speed is 25 minus 10, which is 15 m/s; multiplying 15 by 18 over 5 gives a speed of 54 km/h.