If a crash is "inevitable" and there's no way out then change the game. If the potential impact is calculated to be fatal to the occupant then trigger explosive bolts and blow the wheels off the vehicle to increase friction as the body slams to the ground. Have an underbody plate that's built to be ready for this and is contoured and/or spiked to reduce spin and keep the vehicle on a straight path. Effectively just do what a turtle does. Pull up your legs and get ready for the impact.
Collision systems today only trigger once the crash is already happening. If you're in a guaranteed "no way out" scenario in a vehicle smart enough to know then you can slowly inflate the airbags to cushion the cabin (even at child-safe speeds). An extra second is a lot of time for collision mitigation.
If the crash is expected to be at a low enough speed where your survivability is not in question then there's probably more risk involved if you swerve off the road. That should keep you from plowing over pedestrians, but the underlying intent is to keep you from swerving into a river.
Like some have said above...do whatever is best to protect the occupant(s). Most of the time anywhere off the road has a high probability of getting you more seriously injured than on the road. If there are squishy pedestrians around there's also probably a lot of heavy anchored things like telephone poles and buildings. Those are not usually a better target than the car that's swerving into you.