Australia lost the Gqeberha Test by an innings and 31 runs after their batting came a cropper.