Given, the length of the train A and B is 400 m each.
Both the trains are moving in the same direction with the same speed, so the relative velocity of both train is zero, that is,
Let
The second equation of motion is,
Substitute the value in the above expression.
Thus, the original distance between the driver of train A and guard of train B is