Why are vaccination campaigns, rather than trolley cases, the right analogy for injury-minimising programming?
Because a vaccination programme also imposes a small risk on unidentified individuals to lower everyone's risk — nobody's interests are sacrificed for the majority's, so it clears the Kantian bar.
* The test is not »does anyone get hurt?« but »is anyone being used?« *
Vaccination has exactly the structure at issue. It typically protects those vaccinated against the disease, while carrying a risk of harm from the vaccine itself. For a range of vaccines it is foreseeable that some — though a very small proportion — of those vaccinated will fall seriously or even fatally ill as a result.
What makes the practice justifiable is not that the benefits outweigh the harms in a ledger. It is that the interests of one person or group are not being sacrificed for the interests of the majority — even though the majority, and the community as a whole, also benefit. Each person vaccinated is themselves better off in expectation. Nobody is being used.
Applying that to the cars: a programming that offsets casualty numbers is therefore — like vaccination — not ruled out in principle even from a deontological standpoint. Put in Kantian terms: no one is treated as a mere means; everyone is also an end of the rule. That is a fundamental difference from attempts at harm minimisation in classic trolley cases, where the sacrificed person is identified in advance and gains nothing from the choice.
Tip: The Kantian test is not "does anyone get hurt?" but "is anyone being used?" A rule that lowers your own expected risk is a rule made partly for you, even if it is the rule that eventually kills you.
Go deeper:
Wikipedia: Vaccine adverse event — the real, small, foreseeable harm side of the analogy — what it is and how often it happens.
Wikipedia: National Vaccine Injury Compensation Program — how one legal system compensates the unlucky few without treating the programme as a wrong.
Wikipedia: Herd immunity — the collective benefit that makes the analogy tempting — and the part that is not what justifies it here.