South Africa's president Cyril Ramaphosa could be impeached after the country's top court ruled proceedings against him can be revived.