Gauff rallies, outlasts Hercog to reach 4th round