Desertion of the Dinobots (1) - S2-E19
Plot hole: Perceptor discovers that the reason for their malfunctioning is because their Cybertonium has deteriorated after millions of years of being exposed to Earth's atmosphere. The key word here being 'millions'. This explains why the original Transformers who crash landed on Earth (4 million years ago) are affected, but newer characters like Perceptor, Powerglide, Hoist, etc. are affected despite the fact that they have only been on Earth recently.
Answer: It is whichever ending you want. There is no 'real' set or canon ending to the war. The only semi-resolution is Beast Wars occasionally hints at the Autobots winning (before the Maximal upgrade). However, Beast Wars is a combination of the US cartoon and the US comic, and excludes most of the Japanese continuity. So it is really up to you as to what you want to believe. Most people seem to 'accept' the US universe, ending with Beast Machines.