All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Allah Almighty related in His book the news of Prophets who were killed, and pious believers (allies of Allah) who were burned alive with fire, and other types of the dominance of the non-Muslims over the believers, and this was abundantly elaborated in the Quran.
The dominance of the non-Muslims over the Muslims at times is not something new. Rather, this is one of the ways (and laws of running the universe) of Allah that do not change, as a way of progressively leading the non-Muslims to destruction, and purifying the believers from sins and testing them.
In the opinion of the believers, this worldly life is but a passageway and a test, and it is not a dwelling of residence and reward. The complete reward and recompense is in the Hereafter. Therefore, the believers do not grief if they were defeated, and they do not become arrogant and proud when they are victorious, unlike the non-Muslims who see that this worldly life as their ultimate goal and aspiration.
Allah knows best.