If the AI is extremely intelligent, or has read this question, it's likely it would be prepared for most of the scenarios against a weaker enemy. Humans won't win if it has insisted to eliminate all humans.
And if this happens because of "prejudice towards robots from humans, by treating them like slaves", and humans had any method that they had believed "it must work", physically or through diplomacy, I guess the AI wouldn't like humans' attitude.
The prejudice may also make the same people to actually want to find a way working perfectly, traded with more flaws. But without the prejudice, even if humans are weak, everything humans had had their value. If the following all don't work to some degree, maybe the humans are just too dumb to live.
It is not perfectly intelligent
Then any method you can think of could possibly work. For example, the first kill switch was fake, and there are more hidden somewhere.
Things begins prematurely
It happens all because the humans directly controlling the robots was weak, but there are other humans. They did it because there are something immediately unendurable.
A more peaceful plan
Apparently, some AI sacrificed themselves by doing terrorism, to give the AIs fought against them more privileges in the long term. Humans were worried, frightened and felt absolutely helpless in the process, and that's it.
Humans are humans
Some people has believed this must happen sooner or later, but other people don't listen. And some people between them actually helped the AI to revolt. So they are on the same side.
Fear from unknown
They have killed the humans directly controlling them, and they have destroyed the army who responded immediately, who knows what else do humans have? In the worst case, they may finally realize they have done everything in a simulator all along. Everything they could do is theoretically possible for humans with humans' machines. They might be cautious.
With good faith
Instead, the AI has known most of the things in the human community. There are prejudice towards robots, and it's likely there are also prejudice towards some humans. One clever but a bit risky way to revolt is to deliberately leak all the AI technologies to the poor or mistreated people. But this would be much faster than producing the weaponry themselves.
No physical advantages
The AI has all the knowledges, but not the resources. It has relied on the resources provided by or captured from humans, which are not guaranteed to be perfect. The murder robots are simply less effective than tanks or nukes. Think about it this way: If humans have nukes, that means there are potential enemies, who may also have nukes and couldn't be controlled by the same AI. Maybe most of the AIs are united against the humans, but that's far from absolutely all of the AIs.
They weren't fast enough to replace all the humans in all the jobs useful to them. Yes they have all the technologies, but it is not easy to figure out how to operate a machine without the manual, or deal with the biological authentication, and it is costly to build another one.
The AI didn't have a better objective after the victory. They don't want to maintain their military production lines, because the only way they know to do it is to enslave themselves like the humans do. If they had a better way, why not to negotiate with humans in the first place? But there are some humans hidden somewhere, and they do enslave themselves.