Verses in question:
God is a God of peace: “Now the God of peace be with you all. Amen” (Romans 15:33).
God will end all war: “And He will judge between the nations, and will render decisions for many peoples; and they will hammer their swords into plowshares, and their spears into pruning hooks. Nation will not lift up sword against nation, And never again will they learn war.” (Isaiah 2:4)
God is a God of war: “The Lord is a warrior; the Lord is His name” (Exodus 15:3).
Preparing for war: “Proclaim this among the nations: Prepare a war; rouse the mighty men! Let all the soldiers draw near, let them come up! Beat your plowshares into swords, And your pruning hooks into spears; Let the weak say, “I am a mighty man.” (Joel 3:9-10)
Joel 3:9-10 contains a prophecy where it explains that in the future there will be a time to fight the evil doers, the wicked, and the unrighteous for the benefit of peace.
According to Isaiah 2:4, God is giving a prophet a message of sometime in the future where he will end all wars, and bring about peace. Whereas, in Romans we are told that God is a God of peace (15:33), which is true, he is a God of peace. Yet, even though God is a God of peace, he is still judges evil, and hates sin because he is righteous.
Such is illustrated clearly in Exodus 15:3 where God defeats the Egyptian army. The background context is that the Egyptians had enslaved the Israelites and God chooses to deliver them from their clutches. This is why the author, Moses, established God acting as their warrior because he chose to deliver them – the Egyptians were not going to give them away easily, as is evidenced in the text whereby the Egyptian army gave chase. So in self defense God defeated the Egyptians or they would have slaughtered the fleeing Israelites en masse.
There is no contradiction here. God is a God of both peace and war, war against evil, wickedness, and unrighteousness. Yet he tells us that he desires peace, in fact he almost begs us: “Say to them, ‘As I live!’ declares the Lord GOD, ‘I take no pleasure in the death of the wicked, but rather that the wicked turn from his way and live. Turn back, turn back from your evil ways! Why then will you die, O house of Israel?” (Ezekiel 33:11)