The train speed is (1050+450)/80 =18.75m/s.
18.75 * 40 = 750m (this is the total length of tunnel+car body), that is, the tunnel length = 750m-450m = 300m.