In Matthew 16:18, the gates of hell shall not prevail against the Church. However, in Revelation 13:17, the Antichrist makes war with the Saints and overcomes them. How can they win and lose at the same time?
The way it can happen is that the group in Revelation 13:17 is not the Church, but believers who come to the Lord during the Great Tribulation. The Church left the scene in Revelation 4 before the Great Tribulation began.
The Greek word translated saints in Revelation 13:17 means holy ones. It’s a different word than the one translated Church in Matt. 16:18. There were saints before the Church Age (the word appears 32 times in the Old Testament), there are saints during the Church Age, and there will be saints after the Church is gone. But there is only one Church. It was born on Pentecost and disappears in the Rapture.