Dramatic attempt to impose martial law exposes democratic vulnerabilities in highly polarised country