In this question we will be assuming that the mass of the car (#m_c#) is less then the mass of the truck (#m_t#),and that the force of the break is the same for the car and the truck. We will also assume that the car and truck are moving at the same momentum, and thus they started at the same place in the same time.
The formula for force applied on an object is
#F=ma#, where #F# equals force applied, #m# equals mass and #a# equals acceleration. Since the car and the truck are moving at with the same momentum, their acceleration equals 0, therefore there is no unequal force being applied on them at the moment.
When they break, however, it is a different story. To stop a moving object, you need to apply a force in the direction opposite to it. This is also calculated as
#F=ma#. The force needed to stop the car is equal to #F=m_ca#, or #m_c=F/a#.
The force needed to stop a truck is equal to #F=m_ta#, or
#m_t=F/a#. Since #m_c < m_t#, naturally the force required to stop the car is going to be smaller then the force required to stop the truck. However, if the breaking force is the same, this changes things up.
For instance, if the breaking force is #F=m_ca#, then it will stop the car but not the truck, which means they will not arrive at the same distance. If the breaking force is #F=m_ta#, then both the car and the truck will stop, with the car possibly going backwards. Therefore, the car and the truck will reach the same distance if their breaking force is the same, and their masses are equal, or if their masses are different, and their breaking forces are proportional to their different masses.
I hope I helped!