The trolley problem also takes place on tracks, so one only has a choice of two specific, unalterable paths. Such is not the case with a car. Also, the choices in the trolley problem is a choice between one 100% fatality, or multiple 100% fatalities. In a scenario with a hitting a car versus hitting a pedestrian, the choice will always be the car, since the pedestrian has ZERO protections, whereas cars have multiple mitigation devices (airbags, crumple zones, collapsible steering wheel, etc).
That is all true.
However, I do think we can extrapolate the trolley problem to a more realistic real-world problem statement as it would apply to an autonomous vehicle (acknowledging that this is NOT the formal trolley problem).
The scenario would be a situation where a collision is imminent and unavoidable. Perhaps the obstacles in the question appeared too late for a braking maneuver to avoid. A kid runs out into the street from behind a parked car for example, or an oncoming vehicle swerves into your lane of travel at the very last moment. Additionally, there is a possible swerving escape maneuver that the vehicle could make to avoid colliding with one of the obstacles, but which would force a collision with the other. And finally, let's suppose that the two possible objects the vehicle would collide with are of different types. Examples: car and pedestrian; car and 20 ton dump truck.
The question at hand then is this: would the autonomous vehicle choose a path that:
a) Causes the least damage to itself and its occupants (i.e. swerve to the smaller object)
b) Avoids unprotected obstacles, even if it means damage to the vehicle itself and risk of injury to the occupants (i.e. avoid pedestrians, animals, bicycles, motorcycles)
c) Avoids potentially catastrophic collisions with vehicles of a larger size class than the AV so as to minimize risk to occupants
I think the only realistic/legal option is this:
d) Obey all traffic laws (i.e. do its best to not cross the yellow line) and avoid leaving the roadway, while using braking and swerving into unobstructed lanes of travel to minimize the force of the unavoidable impact.
(d) may result in hitting that kid that jumped out from in front of the car, but as sad as it may be, the kid was in the wrong and the car would not intentionally cross the yellow line knowingly colliding with an oncoming vehicle (which for all we know may have a nun, grandmother, future president and 5 kids inside).