But again, it doesn't matter, because road cars are traction limited in braking.
Work is by definition (work) = (force) x (distance), or the same thing expressed as an integral.
Distance is the same, that’s a parameter of the problem. If we say that the brakes apply constant deceleration, then that implies that the force is the same, between both cars. Then the amount of energy shed by both cars is the same before they reach the barrier. (We don’t need to use the integral definition for work here, because force is a constant.)
This explains why the people who assumed that both cars dump the same amount of energy arrived at the same result, even though some of the people in this thread appear to be using faulty reasoning.