South Africa hold edge over Australia after 23 wickets fall on 2nd day