The following is a fairly straightforward problem about momentum conservation in inelastic collisions (I am only interested in part (b) of the exercise). The question asks whether the kinetic energy of the system of wagon and persons changes due to the collision. The answer is that yes, the kinetic energy changes, because x-momentum is conserved. However, I am confused about where exactly the energy goes, or which force is doing work. It must be a static friction force, but does static friction dissipate energy?
The solution goes as follows. Conservation of x-momentum yields $$ Mv_{1x} = (M + m)v_{2x}, $$ where $M$ is the mass of the cart and $m$ is the combined mass of the two persons. Thus, the final kinetic energy is \begin{align} K_2 &= \frac{1}{2} (M + m) v_{2x}^2\\ &= \frac{1}{2} \frac{M^2}{M + m}v_{1x}^2\\ &= \frac{M}{M + m} K_1, \end{align} where $K_1 = \frac{1}{2}Mv_{1x}^2$ is the initial kinetic energy.