based on your dialogue alone and the info you share, this is what i would do:
If character B can still feel pain, he may have a reason to be scared.
After Character B says:
CharacterA:(gives an intense death glare)
ChraracterB:(His smile fases away, slowly turning into horror)
CharacterA:
If you do some emphasis of the pain and/or horror of character B, like a close up of character B`s face of horror while beaten, you can change the mood. Drastically
Make sure the face character B does when he says he can`t be killed is not too funny, or it will be harder to change the mood from silly to serious.
hope this helps.