Sadly Peter, there is no way to defeat a warped ideology, as for every one arrested or killed, they multiply like the cockroaches they really are.
They target soft targets, which is typical of schoolyard bullying, picking on the weakest or most vulnerable. They are true cowards who are brainwashed. Similarly they are weak people with weak minds who get recruited.
We cannot guard these soft targets, but we can be vigilant, as a intelligence or police force and as members of the community. These incidents do not just happen as a rule, they are planned, so somewhere people must have their suspicions or have knowledge
Most importantly, we cannot give in to these scum, and we must be united against terrorism and show our disdain for such tactics. I lived years in London where the IRA targeted such targets, and never did it prevent me from carrying on my life, Never did I fear what may happen......at least that defeats the terrorists want to disrupt our lives.