From the very beginning of the story Ralph has doubts about his ability to be a leader but when the boys vote for him, he gains some confidence and begins to try and get them organized. But he quickly starts to see the difficulties in trying to get them to keep a fire going, to build shelters, etc., and he doubts not just his ability but whether there is even a chance they will get rescued.
As time goes on and his battle for leadership with Jack intensifies, he doubts himself even more. After hunting with Jack and reveling in the pleasure of the hunt and the fact that he wounded a boar, he doubts too that he isn't just like Jack, that he isn't a savage just like they are. These doubts intensify significantly after he participates in the murder of Simon.
Even after fighting against Jack's band of hunters and seeing them kill Piggy, Ralph still doubts whether he is doing things the right way. He is considering giving in and joining Jack when he finds out that they are going to try to kill him.
By the end of the story, when the naval officer arrives, Ralph's doubts about their humanity and the ability of anyone to avoid the savagery that he's been a witness to and a participant in cause him to weep bitterly.