You're right. God is not obligated to save any. Justice, according to the idea that all have sinned and fallen short, means that all are under condemnation. God would be just if God saved none. That would be just because none have deserved salvation, according to that line of thought. But if God's saving some is not based in something other than a capricious choice on the part of God, then it is arbitrary.
So, to your initial point, it may seem arbitrary to us but actually not be. But if it only seems that way, then there is some reason for saving the five that is not revealed in the scenario, something other than random, arbitrary choice. Unless I am mistaken, the whole purpose of the scenario is to highlight the unmerited nature of grace. But if grace is unmerited, then why not extend it to everyone? If there is no reason for extending it to everyone, then we are back to a capricious God who makes arbitrary choices.