The work done in stopping the car and the truck can be written as
W==FxΔKE
As both the car and the truck are moving initially with the same kinetic energy, after being stopped, they will have the same change of kinetic energy.
Also, they are stopped with the same applied force.
Hence, from the above equation, it can be written that they have the same displacement, i.e., x1=x2.
Acceleration is a vector quantity. As the direction of motion of the car is different in the two given situations, the acceleration of the car will not be the same.