Ralph becomes more mature over the course of the book through multiple examples. One of these is from the beginning Piggy was the outsider, and Ralph (along with the rest of the boys) treated Piggy as such. Slowly through the book we see Ralph become more open to the idea of difference, and at the end of the book Ralph has considered Piggy a friend. "And the loss of a wise true friend."
Next when Simon brings up the idea of the beast being real the very first time the gathering of boys mocks and laughs at him. Ralph does not. He is appalled that Simon believes in the beast but Ralph does not laugh.
A final example of Ralph's maturity is after the death of Simon. Jack (and his group) say that Simon was a beast, whether to avoid the guilt of murder or if they truly believe that, they still do not accept the consequence of what they did. Piggy also will not accept consequence. Piggy blames Simon's murder on Simon, saying he should not have been sneaking around at night. Ralph is the only person out of all the boys who accepts what they did as murder and nothing less.
In conclusion by the end of the book Ralph has matured faster than should be expected of a child so young. He thinks like and acts like an adult.