If it exceeds, it is equivalent to the local train not moving.
The distance traveled by the express train is equivalent to the length of the express train.
So the length of the express train is (30-22) × 24 = 192m.
In the same way; In a similar way
Start with the alignment of the two back ends.
The express train and the local train are equal in length.
So the local train is) 30-22)×28=224 meters.
So it takes (192+224)÷(30+22)=8 seconds.