this problem can be solved by observing the system in the vehicle's frame of reference.
let, at time t=0 the mass be at x=0
as the vehicle accelerates the mass gains velocity and at some point of time its velocity becomes 0 and it starts moving backwards, at this instant the total work done is 0 as change in kinetic energy is 0
as the mass is observed in a non-inertial frame, the net work done is
Max-1/2kx2=0
therefore, |x|=2Ma/k (x= -2Ma/k)
this system oscillates. with x=-Ma/k as mean position (at this point net force is zero)
hence the other extreme position is x=0
so the answer is (B)