I wouldn't call a maintenance and ops for a large energy intensive Lunar structure "marginal". The dust is going to be a major pain permanently. Powering the system will be a pain, cooling both railgun and power generation for it will be an incredible feat of engineering. And that's just the initial hurdles of what I suspect would be a thick book list just the problems.
PS: I would also leave it to everyone to evaluate how many seconds would this railgun keep existing until the other superpower will blow it up to pieces, "just in case". Question works the same for any owner and any opponent pairing.