Well it is possible to save the ranger when he jumps off the cliff, before you get the third badge. In fact, you can do it before the gym is even open by talking to the Rayquaza statue. When you save him, you are taken in front of the cave. There you have your second rival battle and so on and I think its the end of the beta. You can't go back and get the third badge, since you can't Surf, get a boat and you are pratically stranded, with how the map is arranged.