I'm keeping this one short in an attempt to stop certain philosophers changing this into an examination of the form of my argument rather than its point. All the documentation supporting the statements I make about the histories of science, philosophy, and religion are easily available with a few Google searches.
There is evidence of religion going back hundreds of thousands of years, in the form of burial rituals. Organized religion, of the general form we know today, emerged around 12,000 years ago. It provided answers (albeit ridiculous ones by modern standards) to why things were as they are, which alleviated stress in the community by lessening what is unknown. Unknown = danger = stress. It also provided a power structure around which to organize the community.
Philosophy began within the last 3,000 years, depending on which culture you're considering. However you define "philosophy," it started long after religion. Philosophy sought answers to more or less the same questions as religion - it only phrased them more precisely. ("What does it mean to be?" versus "What is my purpose?") Still, philosophy was fundamentally about explaining and predicting reality. The power structure of philosophy came from ability to reason - those who could reason had an advantage over those who could not. Knowledge is power, as they say.
Science is a bit harder to nail down. Some people argue that the formalization of mathematics represents the establishment of science. I disagree, because mathematics is a broad tool that can be applied to things other than science; that is, it isn't a marker of science only. It's also important to distinguish between natural philosophy and science as we understand it today. The real distinguishing feature of science is the establishment of the scientific method, which is only about 300 years old. Science serves exactly the same societal purpose as religion and philosophy: understanding provides safety and power.
So religion came first; then came philosophy; then came science. If we think of it as an evolutionary tree, it starts with religion, then philosophy splits off from it, and then finally science splits off from philosophy, by way of the "transitional form" of natural philosophy. Note that, unlike natural evolution, all three major disciplines still exist.
The evolution of these three fields was spurred by the ever-growing body of knowledge that they themselves generated. It's a positive feedback loop: the more we learn, the better we understand, the more we can refine and improve our means of learning. There is little doubt that science is the best we've got. It improves in every possible way on its ancestors.
So the question is: why do the progenitor disciplines continue to exist un-evolved*, like coelacanths and sharks? I will offer this suggestion of an explanation.
Biological species evolve in response to changes in their environment that alter the rate of survival of a genetically diverse population. Coelacanths, sharks, and similar animals have remained essentially unchanged because the changes to their environment were insufficient to alter their rate of survival.
I think the reason why religion and philosophy survive and haven't been completely been replaced by science because there are environmental "pockets" where they remain viable. These pockets aren't defined by geography or other physical characteristics, but rather by the personalities and socio-cultural norms of societies and communities. As old people die and are replaced by young people, the young can be indoctrinated (brainwashed) in ways that ensure an unchanging environment.
Perhaps at some point in the future, some new way of learning will be developed that will make science look as ridiculous to some future human as religion does to a scientist of today. The difference will be (I believe and hope) that science will recognize the superiority of that better way of learning about the universe and will willingly accept it. More than philosophy and definitely more than religion, science ought to be expected to welcome that improvement. Which is just another way that science beats its progenitors.
* Some may argue that philosophy has greatly evolved in the last few millennia, and they would be, in my opinion, partly right. There continues to be a great deal that philosophy can contribute to humanity's advancement. But there are also fields within philosophy that are stuck in modes of thinking that are, quite frankly, useless. And because they are useless, they distract others from, and waste resources that would be better applied to, more important questions.