South African Deputy President Cyril Ramaphosa was elected head of the ruling ANC party on Monday, winning a bruising race that exposed deep rifts within the organisation that led the struggle against apartheid.