Though these kinds of moral puzzles are interesting, I think that ultimately, they seek solutions to the wrong problem. The questions they ask assume the existence of an advanced AI that can resolve a lethal situation in a (presumably) less tragic way by implementing some complex moral calculus. However, rather than spending time designing and implementing such an AI, engineers' time could be better spent designing an extremely safe, car-based transportation system, one where these trolley problems become improbable and their ethics less relevant. Part of engineers' efforts would involve educating the public and influencing public opinion, since implementing such a system is more of a social problem than a technological one.

I am not an automotive engineer, but here are some techie layman's ideas for implementing such a system. (These ideas have come from many sources, or been inspired by them.)

1) Make autonomous car slow. Slow cars are significantly less lethal. The average speed of populous cities' traffic is pretty slow anyway, and it doesn't really help anyone for impatient human drivers to rush to an intersection so they can wait for a stoplight. Slow autonomous cars will initially be an annoyance to human drivers, but once they outnumber human-operated cars, traffic will get faster and smoother (when all the cars waiting at a stoplight can start moving again in unison at a green light, for instance, instead of what happens with human-driven cars.)

2) Make cars lighter. Stop the Hummerization and SUVization of cars which seeks to armor their occupants (somewhat ineffectively), but puts others at greater risk of harm.

3) Have more exterior crumple zones on cars which can reduce the energy transmitted to pedestrians and other cars in a collision. Cushion the engine block, possibly move it to the back, or do away with it altogether (as in some modern, prototype cars where each wheel has its own electric motor).

4) Reduce the need for people to ride around in cars. Have more telecommuting, more local commerce, more local production, tighter knit communities, less urban sprawl. Have more people-less vehicles take care of making small deliveries (since such driverless, passengerless vehicles could be made even smaller, lighter, and less dangerous than passenger vehicles... and could also sacrifice themselves in the safest way possible if they were ever about to put someone's life in danger.)

5) Move passengerless, transport cars away from people. Program them to drive on roads in unpopulated areas when possible, even if their trips end up being a little longer and slower. Non-sentient cargo is patient.

6) Make autonomous cars self-diagnose and maintain themselves as much possible, checking themselves in to service stations and repair shops when needed so that their tires are always properly inflated, their brake pads are changed in a timely fashion, etc. Make it illegal to operate an improperly maintained car, and force owners to either sell, or dispose of, or temporarily store away their cars if they aren't currently able to afford the required maintenance.

7) Get rid of "stroads" and fast roads that cut right through residential/pedestrian areas. Evaluate and follow many or all of of Strong Towns' recommendations.

To sum it up: let's work on greatly reducing the likelihood of deadly situations involving autonomous cars, instead of worrying much about deciding who should live and who should die in such situations.