Let length of the train = L
According to the question,
(L + 300)/21 = (L + 240)/18
⇒ (L + 300)/7 = (L + 240)/6
⇒ 6L + 1800 = 7L + 1680
∴ L = 120 m
Taking the length of the 2nd bridge into consideration,
Speed of train = (L+ 240)/18 = (120 + 240)/18 m/s
= (360/18) x (18/5) km/h
= 72 km/h