What's funny is, the god of the Old Testament seems to also be one of those types of gods --- he doesn't deny that other gods exist, rather, he just seems to think that he (himself) is more powerful/more worthy of worship than these other gods, such as when he tells his followers not to worship Baal or Molech in Judges and Leviticus:
There used to be a lot of religions that believed that the gods of foreigners existed, and held power in foreign lands. They held themselves not as the one true religion, but as worship of the gods that held power in their local area. Christianity and Islam replaced them, not just because of forced conversion (although that was a factor) but because those old religions were uniformly fucking horrible, bleak and violent.
He doesn't say that Molech doesn't exist, just that you shouldn't offer your children to him. Also, Yahweh is referred to (and refers to himself) as "God of the Israelites" many times, especially early on in Exodus and some of the other earlier OT books; this is apparently to distinguish him from the gods of other peoples of the time, similar to Molech and Baal.
"Neither shall you give any of your offspring to offer them to Molech, nor shall you profane the name of your God; I am the Lord." --Leviticus 18:21
God never once decrees that these other gods "do not exist," merely that he is better/more worthy than they are. Later on, Christians (and maybe some Jews, though I'm not aware of any Jewish apologetics on this specific point) try to retcon the mention of any "alternative gods" as just alternative names for Satan/Lucifer....but this seems dubious given how few attempts there actually are in the Old Testament to branch them all together. A lot of names (such as Baal) are either titles to refer to a "type" or "class" of god (Baal was sometimes used as either the actual name of an old Sumerian god, or as the Akkadian word for "Master," which could simply be a title), or in some cases, the actual names of other gods (such as later mentions of Baal, or the aforementioned Molech), implying that Yahweh is referring not just to another god, but another god that we have evidence of people worshipping from outside of the Biblical texts. So we have extraneous proof that "Baal" was worshipped at some point, and that proof dates back even farther than the Bible in some cases (as proven by the fact that it is referenced in the Bible --- how can something be referenced in a text, if it did not already exist when that text was written?).
That same night the LORD said to him, “Take the second bull from your father’s herd, the one seven years old. Tear down your father’s altar to Baal and cut down the Asherah pole beside it. Then build a proper altar to the LORD your God on the top of this height. Using the wood of the Asherah pole that you cut down, offer the second bull as a burnt offering.” --Judges 6:24
For all the things that I never did
For all the places I never was
For all the people I never stopped
But there was nothing I could do..."