Here, the relative speed will be given by,
120+80=200 km/h
or (500/9) m/s
(Using, 1 km=1000 m amd 1 hour=60 min=3600 s)
Suppose the length of the other train is x metre.
So,
(x+270) / 9=500/9 [Speed=Distance / time]
or x=230 m
Thus, the length of the other train is 230 m.