News South African President Cyril Ramaphosa gained the upper hand in a power struggle in the nation’s deeply divided ruling party after surviving a bid to force him out of office, clearing the way for him to overhaul his cabinet.