JAKARTA, Indonesia—Democracy and Islam share a checkered history.

Indonesia, the world’s biggest Muslim-majority nation, has been more successful than most in reconciling the two. But here, too, the rise of Islamist politics is undermining civil liberties—and, over time, may end up eviscerating Indonesia’s democratic experiment.

With presidential...