Well... I think the Machines are the villains of NieR: A. Not all of them are of course, but all the significant enemies who are pulling the strings in NieR: A and know they are doing so are machines...
I think the androids are probably the biggest victims in NieR: A. The Machines are purposely fighting a war they are not letting the androids lose because the machines need an enemy to fight because of their programing. The Androids could actually not fight the machines if the machines left them alone while the machines don't really get a choice in fighting nor not because their programing is a lot more restrictive then the Androids' programing is. And the machines reaction, (particularly the Terminals) to finding this out is taking advantage of the Androids' back-door into the YoRHa server and killing all the Androids because as far as the machines are concerned, they don't need the androids anymore if they can get to the humans...
Like, yes... the Machines are sentient. So are the Androids. The Androids have every right to fight for their own existence and keep the Machines from killing them. No android in NieR: A ever questions if they should not be fighting the Machines that are trying to kill them. What really gets to them, especially 9S, is that the Androids though they were fighting for Humanity to come back to Earth, and it turned out Humans were dead the entire time. Which causes 9S to wonder why they are fighting at all if there's "no point" to fighting the Machines. The Androids exist to serve humanity, and there's no humanity to serve. However, the big point of NieR: A, particularly Ending E, is about existing for your own sake, not the sake of what you were programed to do. That is what the Machines like Pascal figure out. It's what 2A, 9S, and A2 (and the Pods!) learn over the course of the game as well.
And Yoko Taro is most definetly misleading us... probably about a lot. That was my entire point about saying we don't actually know what the back-story of most Yoko Taro games is until the very end. Much like in NieR: A though, there's no point in not fighting the machines, since they do want to kill us and everything has the right to fight for its existence.