Science is an incredible tool, but like all tools, it is blind to values. Its application can be ambivalently destructive or beneficial. The application of science has to be regulated by what we consider “good”. Philosophy and religion are there to answer that question.
In considering whether religion or philosophy is more important, I’d say it comes down to compassion. From where I sit, compassion is the indispensable guiding principle in moving us to do the right thing in most circumstances. The more people there are out there being guided by a robust sense of compassion, the less shitty stuff we’re liable to do, and the more our scientific gains will be put to advance our common welfare.
So which is more likely to lead to an actualization of compassion: philosophy or religion? There are plenty of examples of both doing the exact opposite, of course. They can both be perverted to serve selfish or tribal or nationalistic ends. But there are also examples—rarer by far—of philosophers and religious practitioners who have managed to get beyond the self-serving instinct and tap into a deep reservoir of compassion. But I’d propose that in doing this, those individuals transcended any distinction between philosophy and religion.