In the case of Colombia, there are independent investigation agencies that aren’t subject to any of the three branches, and specifically the judiciary branch has a committee that investigates disciplinary trespasses by judges. Also, there are three separate “Supreme Courts”: one handles typical everyday cases, another handles conflicts between citizens and the government, and another handles Constitutional violations. So there are several protections against a rogue Court.
And we still haven’t gotten to the part where government workers, all the way up to the president, are forbidden from making any public statements in favor of candidates or campaigns.