The brutal recent murders of two bloggers, Avijit Roy and Oyasikur Rahman, have drawn global attention to rising Islamist violence in Bangladesh. Roy was a published author, whereas Rahman’s audience was confined mainly to readers of his online posts. What they had in common was an outspoken critique of religiosity and a history of tangling with Islamists online. Yet contrary to first appearances, the killings may be a symptom of the Islamists’ increasing weakness and desperation.

Bangladesh has long enjoyed a reputation as...