How about training people how to react to these terrorists when confronted.
Instead of just standing there and getting shot, perhaps rushing the shooter, such as those guys on the French train did, would be a skill that would save lives?
It's like the old children's tale, "Who will bell the cat." No one wants to go first, because it's the first one that gets shot.