I can never wrap my head all the way around these kinds of false dichotomies.
In the case where the machine can choose between stopping itself, or to keep on running, the obvious choice should be stop itself even at the risk of the passengers. Even if say, in the first case there are two passengers and one pedestrian, what happens if it keeps going after running over the pedestrian? How many more choices will happen in the case of stopping failure? Also, with all the new safety features in cars, passengers in a car that hits a wall are always more likely to come out alive than a pedestrian hit by a car.
Another problem with these nice and clean scenarios, is that they rarely ever occur in the real world. And deaths are never so certain, but as previously stated, passengers are more likely to survive an accident than a pedestrian. There are more options for a much safer decrease in speed as well.
If you can get the machine to decide, it should choose the scenario where no one dies even if it's the least likely outcome. I think that car damage is preferable to lives lost, even non-human animal life.
I just can't commit to either limited answer where I can see alternate options especially if those options exist in the real world.