First lets take a look at a simpler example like a hockey puck (a rigid body). A hockey puck gliding along the ice that's suddenly stopped by a hockey stick looses its kinetic energy in the impact. In this case the energy turns into heat caused by the deformation and restitution of materials at the impact site.
If instead the hockey puck started sliding over a rough patch of ice it would loose its kinetic energy to friction, some of the heat produced would be transferred to the puck and some to the ice.
In both scenarios the same amount of energy was turned into heat however the temperature of the puck at the end would be different and very complicated to predict as it would depend on all of the surface properties of the puck the ice and the hockey stick. These complications would exist for a container carrying a gas as well, and would probably dominate the temperature change of the gas. If this is what you're interested in you would need to look into the tribology of the surfaces in question.
If instead you're interested in how a container of gas would differ from a rigid body, let us simplify away those complications. If we claim that the container holding the gas is perfectly insulative then the heat generated from friction or the impact will stay on the outside of the container and we only have to consider heat generated within the gas itself. In this case the only way heat could be generated is due to the acceleration applied to the container, and the two cases can be modeled as a slow process (a small constant acceleration over a long duration) or a fast process (a strong acceleration over a short duration)
Now if a constant acceleration heated gasses we'd be in trouble, as gravity can be treated like a constant acceleration. So in the case of the slow constant acceleration, heat could only be generated at the beginning and end of the acceleration. At the beginning of the acceleration, the gas would redistribute in the container to create a pressure gradient $a\rho$ and then and the end the gas would redistribute to a neutral pressure gradient. At the beginning of the deceleration the pressure gradient would not be fully developed so the force required to sustain the acceleration would ramp up from zero to $F=ma$ once the pressure distribution had equilibrated. Then at the end, when the container came to a stop and the acceleration returned to zero, the pressure would still be unequal so keeping the container at zero acceleration would still require some force. These differences would balance exactly in terms of momentum. However due to the velocity being zero at the end, the extra force would not transfer any energy to the container and thus less overall energy would be transferred to the container. Of course in our example all of the energy transferred to the container is absorbed in either the impact or as friction.
If the process above is sped up, a larger and larger percentage of the energy is lost due to the starting and stopping effects being greater in magnitude. Eventually, the starting and stopping effects may even overlap as the pressure gradient doesn't have time to form before the acceleration is over. This can be taken to an extreme case where the pressure gradient doesn't even have a chance to form at all, before the deceleration is over. In this case nearly all of the energy would be converted to heat inside the gas. However, I should note that in such cases the impacting surface would have to be sticky as otherwise the gas would cause the container to bounce.
If the container decelerated from mach 2 instantaneously, you might expect a pretty different picture. A shock wave would be created at the forward wall and a vacuum at the rear. The shock wave would pass rearward through the container at Mach 0.65 eventually hitting the vacuum (whose edge would have been moving forward at slightly less than mach 2) and once the shock wave hit the far edge then the system would balance everything out with sounds waves. This would actually be pretty much the same as the previous scenario except if rebounding was allowed in which case this would have a much lower coefficient of restitution.