If a particle of rest mass $m_0$ travelling with a velocity $u$ collides with a stationary particle also of rest mass $m_0$ and then coalesces to form a new particle with invariant rest mass $M_0$ travelling at velocity $v$ parallel to $u$, then special relativity would give following:
$$\gamma(u)m_0c^2+m_0c^2=\gamma(v)M_0c^2$$
This is because energy is always conserved in this way in special relativity. Now, $M_0$ cannot be less than $2m_0$, because this would mean there was an increase in kinetic energy, which is impossible in a collision of this sort. $M_0$ can, however, be greater than $2m_0$ if the collision is inelastic (i.e. kinetic energy is not conserved).
In classical mechanics, an inelastic collision means that energy has been lost to the surroundings as heat or sound. Energy wastage as sound is an everyday experience and an example of energy loss as heat is given here (https://www.youtube.com/watch?v=I4f87E8Z0JA).
However, this seems to me like a contradiction between the reality predicted by the two theories. According to classical mechanics the rest mass stays the same and energy is wasted as heat or sound. In special relativity, the lost kinetic energy does not leave the system as such, but rather makes the coalesced particle heavier. If energy is lost as heat and makes the particle heavier, then we seem to have gained energy from somewhere, which would violate energy conservation laws.
How do we reconcile these two together?