Constitutional courts can and do usually uphold democracy and civil rights against a head of state, as now superficially in the case of Turkey and its internet censorship.*
Autocratic minds know how to cope with this, of course.
One method is to rig the constitutional court by replacing or adding members with reliable partisans.
Another method is to do the same with the executive branch and media, so a ruling can be ignored or be implemented only superficially.
It's worrisome how few if any countries have implemented a countermeasure to this countermeasure. It's rarely within the powers of the court to call for special elections so the people have a chance to get rid of the autocrats. It's as far as I know unheard of that a constitutional court can assume command of police or other armed personnel of the state to enforce a ruling.
The problem is thus that the current dominant design for constitutional courts only works up to the point when the offenders are willing and capable to resist its authority. And this authority is usually only a moral one.
This defines a threshold between democracy and autocracy in my opinion. It's an autocracy once politicians have neutralised the restraining power of the judicial branch. Up to this point it's still a struggle to defend democracy, whereas afterwards it's a struggle to restore democracy.
I believe we should pay more attention to this threshold and build up more defences of democracy to stop a move towards autocracy prior to the tipping point of a neutralised constitutional court.
*: The ruling allows 30 days for implementation, which basically allows the government to keep the censorship in place till the elections. The court is thus not really serious about it..