At what point will the vehicle suddenly find itself in the trolley problem. It's doing several hundred restatements of the scenario per second. It will have started to react far sooner than this theorized last moment decision. In sort the question isn't valid because you're applying a human trait - distraction - to the computer.
Sure there are potential scenarios vehicle crosses into on-coming traffic, a bolder rolls down a hill and lands in front of you, or a sink hole opens as you drive over it and you have to deal with it, but these are easily decided. It's decided by liability, and we already have a framework for that. The liability will sacrifice the person in the vehicle. It will do this because involving a bystander is a liability to the vehicle's insurance company. Meanwhile, in the existing legal framework, you are sill responsible for the operation of a computer operated vehicle. You legally speaking, have only yourself to blame. However even in these dire circumstances, I would trust the vehicle to use real-time data to try to make the accident as survivable as possible, for everyone. I expect it's ability to exceed my own. And I think eventually public opinion will come to believe that too - that autopilot survivability is better than human control in all circumstances.