Earlier quoted context omitted.
How many people would need to die for it to be justified in your eyes? Or maybe just focus on the potential loss of cargo from trucks on the bridge, if that helps you.
How many? It depends on the opportunity cost of installing and maintaining whatever half baked thing (lights, sirens, computer vision, AI, barriers) it is OP is envisioning on how many thousands of bridges versus the frequency of issues it will prevent. This calculation is done all the time but not so much by the "if it saves only one x" crowd of clever solution proposers.
I love how we jump to AI when all we need is 4 cameras and a dude with a pair of eyes...
Wait until you learn how train barriers worked not so long ago