Note that this is only one approach to the problem, and one that is used by exactly zero of the current autonomous car systems.
In practice this kind of decision is extremely rare. A much simpler algorithm is to minimize loss of life. It’s only in the case where it’s either one person or the other that such a decision is relevant. If the software seeks to minimize collateral damage, that further simplifies the decision process.
It seems to me that no life should be given priority over another, except when age is a factor. If it must be either a child or an adult, I think most would agree that the child should live - including almost all adults. Otherwise, flip a virtual coin.
It’s also worth considering that given human reaction time, most humans are likely to make bad decisions in these situations regardless - often resulting in extra loss of life.
A pretty standard decision matrix for these things is to “aim” for the object that’s furthest away. Furthest away give more time to slow down and more time for the “target” to take evasive action thus maximizing the opportunities to avoid the accident and reduce over all damage if it isn’t avoided. That’s actually the defensive driving instructions we’re supposed to use.
So a group of teens run into the street forcing the car to make a decision about the greater number of lives saved, and so goes off the side of the road. Would kids do this? You betcha.