So AI can build everything except the factory itself? Sounds like there's still a need for human labor.
And if the opposite is true and AI can build the factory, then it's not going to "cost tens of billions of dollars to build"; the factory will be just as cheap as the goods its producing. Literally everyone could have their own factory.
So whoever builds the first one will be able to quickly expand, buy more land and solidify their lead.
Land is likely what would cost billions in this specific scenario.
If you don't have land or materials then there is nothing your AI can do, because it doesn't have anything to build things from.
There was a podcast I listened to on this subject "The Plunder of the Commons" which I found really interesting. [1]
That said, we're a long ways away from reaching the point where literally not having anywhere left on the planet to build becomes your primary obstacle to starting a business.
[1]: https://politicalorphanage.libsyn.com/the-plunder-of-the-com...