You could start by running a normal Dijkstra's algorithm so you know what the fastest route is so that you know when the safest route exceeds this cost by some factor.
You could then run it again with safety as the main cost function, but also calculating the distances to rule out some routes. At first I thought this could be done like the normal Dijkstra's algorithm but by storing an ordered list for each node (previous node, cost, and safety value). The issue with this is that as distance and safety are apparently independent (in reality there's some sort of correlation but not one we know how to model). This is an issue as you need to prevent long distances early in the route wrongly leading you to rejecting options later in the route.
This need not be a problem if you could can apply the distance limit on partial routes. That is you don't accept a route to any intermediate node if it longer than twice the shortest route from the start to that node. I know that this isn't exactly as you stated because you asked about restricting only the route length to the final node, but maybe it still helps you in thinking about the overall solution. For what its worth it might also be more realistic.
Remember to combine the crash probability correctly, you can't just add it up. If we assume the journey stops at the first crash then you'd be calculating the probability of the crash as probability of crash on road 1 plus (probability of not crashing on road 1 * probability of crashing on road 2) plus (probability of getting to road 3 safely * probability of crash on road 3) etc (sorry if that's obvious).
Given your comment, I'll explain more on the probability (and it is probability and not odds you'd be best looking up)
If you want an overall measure of safety that allowed for continuing after a crash then it gets more complex.
If you stop when there's a crash then its a matter of calculating probability of crashing exactly once.
So a route has a crash if:
you crash on the first road (probability p1) OR
you don't crash on the first road ( probability 1-p1) but you do crash on the second (probability p2). OR
...
you don't crash on roads n-1 (1-running total as above) but you do crash on road n (probability pn)
This way you don't get cases where a 50% chance of crash on roads 1&2 doesn't add up to an overall 100% chance - and you'd never get greater than that either.
In reality lots of crashes happen at junctions, and there will be a different probability of crash depending on whether you turn left or right - so the probability is not (in reality) just dependent on the safety factor of the roads between the junctions but also how the route combines them.
The probabilities should be weighted according to use (lookup conditional probabilities) so if there were 20 crashes on a rarely used road that may need to be modelled a having a higher crash probability as a busy road with 50 crashes in the same time period.