
Source
Although we are still halfway there, sooner rather than later autonomous driving will reach Level 5, which means that vehicles will be able to move without the control of a person and will not even have a steering wheel.
When this time comes, vehicles will have to make quasi-human decisions, when it is impossible to save the occupants without harming other occupants of the road, be they pedestrians, cyclists or any other vehicle.
The best-known example is that of a tram circulating on a road in which there are five people tied to the rails, the driver has the option of changing the track but on the other track there is 1 person tied and a decision must be made because the tram it cannot be stopped.
An international group of scientists are studying how the brain does to make these kinds of decisions, putting patients in a helmet full of electrodes to make an encephalogram that allows them to analyze the process.

Source
This encephalogram was performed on 41 patients who had the problem of the tram with different variations in the number of people on either route, while recording their brain waves.
Then they compared these patterns with others of decisions without moral charge and discovered that a type of waves called slow brain waves (delta, theta and alpha) exerted more weight in making these kinds of decisions.
It seems that these scientists have the healthy intention of studying the decision-making process of this type in humans, to later apply it to autonomous vehicles once the long-awaited level 5 is reached.
But all this, in my modest opinion, doesn't make much sense since the human brain has too little objective information to make such an important decision.

Source
If we assume that the driver does not know any of the people involved, the only somewhat objective information he can obtain is sex, age and little else, the rest of the decision will be made based on his social/religious education and its prejudices.
The autonomous tram would identify all the people and would know not only their sex, age, nationality, would have access to the clinical history of each one of them and could estimate the life that each one had left, would know if they left a widow and 4 small children or It is a scoundrel that spends everything on drinks, etc, etc.
This is when the human being has to intervene and train the monster to make the correct decision based on all the data obtained and the criteria of a committee of sages that will be introduced as parameters in the neural network.


Versión en español