Let the length of train be x metres and length of platform be y metres.
Speed of the train relative to man = (54 - 6) kmph = 48 kmph
= 48*(5/18) m/sec = 40/3 m/sec.
In passing a man, the train covers its own length with relative speed.
Length of train = (Relative speed Time) = ( 40/3)12 m = 160 m.
Also, speed of the train = 54 *(5/18)m / sec = 15 m / sec.
(x+y)/15 = 20
x + y = 300
Y = (300 - 160) m
= 140 m.