To add to what SpacyRicochet said, he's been trying to maintain a moral standard not just for himself but for Ravi as well. They just had a conversation about how he can't ignore the prostitute's plight for Ravi's sake not too long ago. Even when he explained what a prostitute was to Ravi he did it in a way that emphasized "goodness" by showing empathy and understanding for both them and their customers. Some of the comments say that he should ignore the delinquents because they attacked him earlier or how they were acting. Even if he is under pressure, DECIDING that he should leave them to die would be saying that they should die over that slight towards him. Suggesting that death is an appropriate punishment for causing you problems is a terrible example for a child and would likely lead Ravi to grow up to be a bit of a bitch if she actually took that to heart.
More so, he isn't making his decisions under the premise that one of him, Ravi, the delinquents, or the prostitutes have to die. He didn't jump out in front of Ravi thinking he would die in the place of any of them. You guy's know how these stories work. Hell, it isn't even a matter of the kind of story it is. Why would he give up on fighting for all of their lives and just decide to die himself. It isn't a trade off unless you've already assumed one of them had to die in the first place.