I (perhaps somewhat naively) assumed that a self-driving car would be programmed to prioritise the occupants of the vehicle (as that most closely emulates the likely reactions of a human driver in that situation).
Self-driving cars are likely to be safer than human drivers anyway, so one has to consider how much risk there is of a situation like the Trolley Problem arising - i.e. not much.