As we see in this clip Trautman puts the gun down, but in the next moment of the filmed ending, Rambo grabs Trautman’s hands and moves the gun back into position.
After Rambo has brought the entire small town police force down on his head, Colonel Trautman goes in to try and talk Rambo down.
It’s unclear exactly who is the one pulling the trigger, Trautman or, more likely, Rambo himself.
Rambo asks his friend to kill him, Rambo is clearly in pain.