@Simon: LearninDaMath has calculated the time needed to decelerate the car from v0 to full stop and the time of acceleration back with the formula t=v0/a . After that, he used the formula vf2-vi2=2a(x-x0) to get the displacement, which is valid for uniform acceleration. He just forgot the that the train moves with constant velocity.
You are right, Physics has to be understood instead of just using formulae. But lots of schools teach how to find the proper equation and use it from a formula sheet instead of teaching Science.