There are a couple of ironies, here. First, the fire that they set to kill each other is what the passing ship sees that leads to their rescue. So, something intended to bring death, actually brings salvation. Secondly, the officer (who has been in war and killed people himself) is appalled at the boys' savagery.