Nintendo has (finally!) released an Official Timeline for the Zelda series, in which there are no fewer than three canonical timeline splits resulting from The Legend of Zelda: Ocarina of Time: In one of them, Link is defeated by Ganondorf, although that's also the only timeline in which the royal family of Hyrule eventually gets the whole Triforce. (The first four games released in the series, along with the Oracle games, fall within this timeline.)
Hyrule Warriors has a slightly minor example. While Ganondorf does ultimately get defeated in the end, a good part of the last third of the game is Ganondorf systematically beating down the heroes and managing to take over Hyrule Castle and obtain all three pieces of the Triforce.
The start of Paper Mario has Bowser successfully take the Star Rod, imprison the Star Spirits in cards, and then successfully defeat his archenemy Mario despite Peach believing that Bowser would never able to do such a thing. Fortunately, he later gets an opportunity to battle Bowser again, this time after he rescued the Seven Star Spirits.
Star Fox 64: If you do not succeed in defeating Star Wolf in Fichina before the bomb goes off, destroying the Saucerer in Katina, or taking out all six missiles in Sector Z before they reach Great Fox, then you get depressing music and an out-of-place "Mission Complete" (if you succeed with doing what these levels ask, it says "Mission Accomplished" instead) as the level ends. It does alter the path you're allowed to travel, though. In the Fichina stage, Wolf even lampshades this by saying "Looks like WE win today, Star Fox!" The third one is the only loss you can't recover from, since it sends Star Fox to the Bolse satellite level, which is the start of the path to the "bad ending" with Big Bad Andross surviving with the Final Boss being a robotic double;
Freedom Planet has Lord Brevon successfully invade a kingdom, behead its king despite all of the royal guard banding together to try to stop him, and successfully brainwashing his son in order to become his obedient minion. He later succeeds in obtaining the Kingdom Stone. And according to Torque, he's won MANY times before.
In Transformers: The Game, Megatron succeeds in killing off Optimus Prime and using the AllSpark to conquer Earth.
If we have learned one thing from Blizzard games in the past two decades, it's that Evil almost always wins. Any victory for the heroes is always only temporary and things will get much worse.
The first WarCraft apparently ended with the orcs winning and burning down the human city. (There were two possible endings, the canon is the orc victory).
The WarCraft 3 add-on Frozen Throne ends similar to Brood War. The final showdown is a fight between the games two main villains, Arthas and Illidan, who race for the Frozen Throne to either save or destroy the Lich King. The game ends with Arthas claiming the helmet of the Lich King and merging its soul with his own, becoming the most powerful being in the entire world and ruling over not one, but two kingdoms of undead.
In the human campaign of StarCraft, Jim Raynor joins the rebel leader Mengsk and becomes a close friend with Mengsk's lieutenant Sarah Kerrigan. When victory over the Confederacy is at hand, Mengsk simply abandons Kerrigan to the Zerg, almost manages to have Raynor killed, and creates his new evil empire.
Things get worse as the story continues in Brood War. By the end, Kerrigan has all her goals accomplished and her enemies destroyed.
Averted in Diablo III. Destroying the Cosmic Keystone turned out to be a good thing since its real purpose was to seal humanity's true power. The newly empowered heroes end the reborn Prime Evil's reign of terror forever.However...the Expansion Pack has not been released yet, so it remains to be seen if the trope will be played straight after all.
And now that it's out we now know that Everything done in the main game was pointless cause the black soulstone is stolen by Malthael and eventually destroyed releasing all the prime evils back into the world. The pattern continues! And there's the added aspect that Tyrael has gained a new fear, mixed with respect, for the Nephalem. If they are able to kill the embodiment of death, what would the world do if they ever decided to use their powers for evil?
In Halo: Reach, everyone on the planet is Doomed ByCanon and the Covenant completely overruns the planet, turning it into a smoldering wasteland and destroying a large amount of the UNSC fleet. Counts double as a Pyrrhic Victory for the Covenant, who lose far more ships than the UNSC.
If we assume Calypso winning can be considered fitting this Trope in the Twisted Metal series (given that pretty much everyone is evil, although he's the Big Bad), he will usually triumph in the end and screw over the winner by perverting his or her wish. (The key word is usually. With the exception of the third game and the reboot, there are a few endings where someone gets the better of him, although, in the reboot, his victories are all cases Karmic Justice.)
Nyarlathotep gets to make the Moral Event Horizon his bitch in Persona 2: Innocent Sin when everything on Earth save for Sumaru City is put through Class 6 Apocalypse How after Maya Amano is killed by Maya Okamura. Persona 2: Eternal Punishment is all about trying to stop him from doing it all over again.
Robotron 2084: Aside from the fact the game itself is not winnable, the game's sequel, Blaster, reveals that you have failed to save the last human family. According to its opening demo, "The year is 2085 and the Robotrons have destroyed the human race. You escape in a stolen space shuttle. Your destination: Paradise. A remote outpost 20 million light years away. Does paradise exist? Can civilization be started again? These questions will be answered at the end of your journey. But first, you must BLAST... OR BE BLASTED!"
Velvet Assassin: Violette fails to kill her target, gets wounded in the process and hospitalized. While the villagers protect her, her location is eventually revealed to the Nazis. When she escapes the hospital, she finds the Nazis exacting horrific punishment on the village that protected her by rounding up the villagers, locking them into a church, and setting it on fire. Violette attempts to rescue them but fails and the leader of the attack was the guy Violette failed to kill.
Xenosaga: Wilhelm technically won, having brought to an evolution of the collective subconscious.
However, it's subverted because this can be considered a good thing for everyone overall since Wilhelm himself exists solely as a protector of humanity. His massive Gambit Roulette would've made him win no matter the outcome. He's just that good.
Any video game ever that allows you to take on the role of a Villain Protagonist. (At least, that's the player's goal.)
Especially a game like Overlord, where no matter where on the moral compass you end up, the bad guy (you) wins.
Holds true for Streets of Rage where in two-player mode, if one player accepts the offer from the Big Bad to join him and the other player refuses, both players then have to fight to the death. From there, the surviving player is made the offer one more time. If the player says no and succeeds in defeating the Final Boss, the player becomes the new criminal overlord.
Both the Street Fighter and Mortal Kombat series frequently gives the player the choice of playing an evil character, with an appropriately nasty ending if they beat the game. In fact, this is true of the vast majority of fighting games in general.
The first Paper Mario plays this trope from the beginning instead of the end. Bowser steals Peach's castle and proceeds to kidnap her, only for Mario to show up as usual. Using the Star Rod, Bowser becomes invincible and stomps Mario in battle, making it the first time in Bowser's history that he was able to defeat Mario in a fight. Since this happens in the beginning of the game, it's not truly over for Mario as he does recover from his defeat.
Dreamfall. The Empire hunts down La Résistance to its secret base and wipes everyone out. The heroine gets impaled on a spear and left for dead. The Knight Templar who's just undergone a Heel–Face Turn gets arrested for treason. All prominent members of La Résistance are seen either unveiled as The Mole or charging into a Bolivian Army Ending. Meanwhile, while the other heroine is busy saving the world via astral projection, a miscellaneous villain takes advantage of her helpless physical state to inject her with a lethal amount of a coma-inducing drug. WATI Corp unveils the brain-sucking product, which you've spent the entire game trying to destroy, to great public acclaim, and the last shot shows the enormous evil villainous tower surrounded by ominous lightning. The end.
The backstory of Mortal Kombat 9 gives you this easy question: Who is the canonical winner of Mortal Kombat: Armageddon? The answer is... ShaoKahn. Though Shao Kahn is eventually killed (possibly permanently) in the game proper, it comes at a high cost. Earth Realm is in ruins, and most of the heroes are dead. All according to Shinnok's and Quan Chi's plans. Raiden surviving the entire ordeal was the only thing that didn't fall into their plans.
Raiden: "Our story has ended. Centuries of battle, meaningless. Shao Kahn has consumed Earthrealm."
While Shao Khan was the canon winner of the Armageddon, it was even a Downer Ending for him; he ended up in a Victory Is Boring situation and was eventually driven mad. In fact, this tends to happen in a lot of character endings in the Mortal Kombat franchise; whether the character is good or evil, "winning" does not guarantee a happy ending for that character.
One of the possible endings in Cave Story has the protagonist and Kazuma get away and spend the rest of their lives hiding out in the mountains while the bad guy completes his plan and all that stands in his way is the military powers of the world.
F.E.A.R. 2: Project Origin. Alma succeeds in getting pregnant by you with "the Antichrist". Subverted in a sense, in that Alma isn't necessarily evil (Armacham Technological Corporation is much worse), and that the baby doesn't really do anything, and is more or less a neutral party, even by the time s/he is born at the conclusion of F.E.A.R. 3.
Odin Sphere if you get the bad ending. Everyone dies, but the antagonist sought that in the first place.
In the Neo Geo game Cyber Lip, the main characters are ordered by the President to destroy a supercomputer that has turned against its masters. The twist comes in when the supercomputer has been acting against its will and the true mastermind was none other than the President himself, who is actually an alien invader in disguise.
While he's not exactly the bad guy, The Elder Scrolls II: Daggerfall ends in this way if you give Numidium's totem to Mannimarco. And it's your own damn fault. Also, even if you go with another ending, Mannimarco still achieves apotheosis because everyone got the totem in the end. It's a long story...
The endings for the campaigns in the Dawn of War expansions Winter Assault, Dark Crusade and Soulstorm, depending on which faction is chosen, include indiscriminate slaughter by the tides of an Ork WAAAGH!, the systematic extermination of all life, or the collapse of reality as the Warp crosses into Real Space. The other endings aren't that much better.
Castlevania: Legacy of Darkness. After you overcome the final boss you find out that he was a decoy, the whole thing was a set-up, and you've played into Dracula's hands and only aided him. A Doomed by Canon form of the trope since this is a prequel to the original Nintendo 64 Castlevania.
Any Endless Game, including almost every "classic" video game ever made. Missile Command? No matter how many incoming missiles you stop, eventually your cities get nuked. Donkey Kong? Save your girlfriend? Fine, there's always another level, and eventually you run out of lives and Kong keeps the girl. Space Invaders? The aliens keep coming, faster and faster and faster... Early video games didn't tend to have formal endings and simply kept repeating the same gameplay over and over again. At some point, you die, and the villain in question still is out there, waiting for you to feed in another quarter.
In these sorts of games (which were not, even at the time, the only sorts of games) there often was a clear possible goal which really was tantamount to winning, such as to max out the score (which usually would happen at or around a million points), or to reach a level where the programming simply gave out, either messing up the game or automatically resetting it (often at or around the 255th level or screennote In 8-bit systems the digits max out at 11111111, or 255). Activision's Atari 2600 games actually addressed the infinite cycle problems clearly, specifically, and directly by giving you (sometimes multiple or even ranked) goals for scores to attain, often with specific guidelines for difficulty settings and all, for which you'd get things like patches and t-shirts as rewards for having "beaten" them, and the company's own recognition as being among the world's best gamers for having maxed out the scores.
In at least one or two cases, though, these games might deliberately work with the premise in an intentionally prearranged, plot-oriented "bad guy wins" scenario. One example which comes to mind is Imagic's Atari 2600 game "Atlantis", which had what may well have been the first ever video game Sequel Hook. After the inevitable defeat in which the city of Atlantis finally falls to the Gorgons when the last of it is destroyed by one of the Gorgons' waves of "Space Invaders-crossed-with-"Missile Command"-like attacks, the Cosmic Ark rises from the rubble and takes off, creating a hook for Imagic's follow-up game in which the remaining Atleanteans roam the galaxy finding the remnants of other dying civilizations to add to their own small remaining numbers aboard the Cosmic Ark.
The real Big Bad of .hack//GU, Ovan, ultimately accomplishes everything he wanted. However, considering that his real goal was to make Haseo powerful enough to defeat him so that he could purge the Internet of AIDA, this isn't really a Downer Ending. And Ovan doesn't get away unscathed for his crimes either.
Live A Live has a possible one. After the Medieval Chapter, you can choose its protagonist Oersted, now known as Odio, as the final protagonist. Unlike with the rest of the characters, his version of this chapter is different in that you play as the Demon King through all his incarnations in a subverted Boss Rush in where you kill the main characters of the rest of the chapters. Ultimately ending all existence, and giving you the Sad End. This isn't a Nonstandard Game Over, it's an actual ending. Did I mention the rest of the game probably had made you cry many times before?
Armored Core 4 Answer plays with this on the final ending. In the first two, you're treated to fairly standard, if bittersweet epilogues. On the third, however, you wind up siding with Genocidal maniac, Old King... and dive over the Moral Event Horizon in a horrifying way: a wholesale genocide of 100,000,000 people. Being the player character...
Call of Duty: Modern Warfare 2 reveals that while the first game's Big Bad was killed, his Ultranationalist soldiers won the 21st-century Russian civil war anyway (with the Loyalists nowhere to be found afterward), and he's being hailed as a martyr, making the already pretty bleak ending of the first game even more bleak.
The Big Bad also wins, despite being killed at the end by the player character, in that he got the Russo-American War he'd been wanting, while the Big Bad's erstwhile ally Vladimir Makarov was allowed to escape in return for intel on Shepard's location.
An in-universe TIME magazine cover given out with GameStop preorders of Modern Warfare 3 declares "General Shepard Laid to Rest in Arlington," implying that his conspiracy remains a secret known only to Soap and Price — now international fugitives — and on top of that, the Russian president's daughter has vanished, causing him to stall peace talks, with Russian forces already fighting in lower Manhattan, New York City...
Ultimately Zig Zagged. Shepherd dies, causing a new supreme commander for the American forces to be appointed. Shepherd's main plan was to usher in a new age of American dominance, which included invading Russia and reducing it to rubble after Russia wastes all its soldiers on offensive campaigns in Europe and the US. The new commander, "Overlord", does not share this view, and ultimately when offered peace the United States takes it instead of launch a counter invasion. However, Shepherd remains a war hero revered by millions, and due to Russia's aggression the United States is very likely to be a more militaristic nation involved with more foreign affairs, which presumably includes watching Russia very closely and increasing the levels of forces in Europe.
Walter Sullivan wins in the "21 Sacraments" ending of Silent Hill 4: The Room.
In Touhou Project 12: Undefined Fantastic Object, the antagonists are a group of Youkai trying to free a powerful magician who has been sealed away in the Demon Realm for centuries. Despite (or perhaps because of) the protagonist's interference, they succeed...except their mistress turns out to be a really nice person who just wants to live out her life in peace.
Touhou 8: Imperishable Night might also count, as while Kaguya and Eirin were defeated by the protagonists and the moon was restored, they still succeeded in their primary goal of evading the Lunarian envoys.
Suika, the Final Boss of Touhou 7.5: Immaterial and Missing Power, did canonically defeat the main character in the end. But then again, Suika isn't exactly a bad guy, even if she is a bit bitchy in this game.
Touhou 13: Ten Desires is similar to 12 in that the cause of the incident is a revival that you fail to stop. Unlike 12, Miko turns out to be a somewhat dubious person.
Two of the three endings of Fahrenheit result from one of the two bad guy factions overpowering Lukas in the end. One faction are an Ancient Conspiracy that has been controlling humanity for centuries, anyway, so it's not so bad (status quo is preserved), but others are a bunch of homicidal artificial intelligences which wipe out humanity as their first move.
A few of the endings of Heavy Rain, to varying degrees. It's quite easy for Scott Shelby to merely make off as a Karma Houdini, if he kills whoever he fights in the final battle and also doesn't save Lauren. Quite possibly the biggest downer has all the heroes making it to the last confrontation, and dying, getting arrested, or otherwise failing, while the bad guy walks off into the rain, 100% ready and willing to kill again. You even get an achievement for it, called "So close..."
Arc the Lad II. Even though the heroes win and defeat The Dark One, the titular Arc and his love interest both die, and most of the world is completely destroyed. One of the characters puts it "but at least there is something left!", but it does not change the fact that the bad guy managed to more or less wipe out 9/10 of the world's population.
In R-Type Delta you get this ending if you choose the Cerberus. It's the most powerful ship in the game created using Bydo technology. And it's because of this that the ship gets stuck in the Bydo dimension when it tries to escape.
At the end of Red Dead Redemption, Edgar Ross betrays John, leading an attack by a U.S. Army unit on his home, ultimately killing him. While Jack can take revenge and kill Ross in the Playable Epilogue, John ultimately goes down in history as a vicious outlaw and Ross as a hero who brought peace and justice to the Old West.
Bonus points for Edgar Ross, as the epilogue implies that Jack Marston is heading down a path that mirrors his father's, which is exactly what John was hoping to avoid for his son.
The Story end is also this... Turns out Mu-12 is only a distraction for Terumi's primary goal: Takamagahara. The destruction of Takamagahara means that there will be no more Reset Button. Regardless, Ragna failed his goal in killing Terumi. There's still a sequel, though not necessarily the last, which means Terumi can still win.
In the sequel Terumi and Relius are defeated, with Terumi Killed Off for Real and Relius rendered helpless...but the real villain of the series, Izanami the goddess of death, wins. She brainwashes Ragna into becoming her slave and launches plans to create a "world of death".
Vayne of Final Fantasy XII wins, from a certain point of view. His goal is to conquer Ivalice, but he partially wants to do this to free humanity from the control of the Occuria, god-like beings detached from the world that rule it to their liking by granting power to the people they decide should be in charge. Vayne and Archadia overthrew that person, the King of Dalmasca (though by then, he only ruled his small city-state not the once continent spanning empire of his ancestor, the Dynast King), and Princess Ashe realizes accepting the Occuria's favor to fight back isn't worth it since it will cause more war and death. This is even remarked upon by the rogue Occuria Venat who was helping Vayne — when a dying Vayne at the end of the game laments he failed Venat, Venat comforts him that no, he succeeded enough, in casting off the Occuria's reign.
In Final Fantasy Tactics, the anti-hero Delita becomes king and the hero is banished from society or potentially dead.
Perhaps not so much so in the long run, à la Watchmen above.
The Glabados Church orchestrated a conspiracy to get all the nobles to kill each other in order to create a power imbalance so they can step in and take control. They don't even need demons and they manage to take control of Ivalice for centuries and branded the heroes as heretics. On the other hand, that has come to an end when a scholar found a document calling the Church out of their corruption finally exonerating said heretics.
In the original Final Fantasy XIV, Nael Van Darnus shrugs off the loss of the Lunar Transmitter saying it was already too late to stop Dalamud. Even though he was eventually slain by the adventurers that would be remembered as the Warriors of Light, Dalamud was shattered, and Bahamut broke free. Even when called to Eorzea to recontain him The Twelve failed and could do nothing to stop him. Louisoux was forced to warp the denizens of Eorzea years into the future seconds before they would be consumed by Mega-Flare while he himself was forced to stay behind and die.
Haru's ending of G-Senjou no Maou sees the villain succeeding in all of his plans: The main character's home city is destroyed, all of his family is dead, his foster father is dead, the yakuza clan he was part of has abandoned him, and his job, future and reputation is ruined. To top it off, the villain succeeds at a Thanatos Gambit that sees the main character serving eight years for said villain's murder. It's still something of a Bittersweet Ending because he got the girl in the end.
He wasn't Good All Along. He thought that destroying the Patriots would lead to global anarchy and chaos, or as he puts it, "the Wild West all over again". Like Liquid and Big Boss before him, he wanted a world of perpetual conflict for soldiers to find meaning in, without the Patriots or anyone else pulling their strings. In that, he failed, even though his plan actually succeeded. It is a subversion, but not of that type.
The Metal Gear Solid series actually hints a few times that in the ending of the game, the bad guys (or rather, the ones behind the scenes) are actually the ones who always win. In the first Metal Gear Solid game, Revolver Ocelot managed to retrieve the REX data for Solidus Snake. Metal Gear Solid 2 makes it a bit more apparent (as in, previously, as well as the later games, it was only revealed in The Stinger, with Metal Gear Solid 2 making it more apparent before the Stinger that the bad guys did indeed win), with the Patriots actually succeeding in their plans in regards to the S3 plan, the repercussions of which are made apparent in Metal Gear Solid 4, and the Patriots are heavily implied to be the true villains of the game, instead of Solidus.
In AdventureQuest Worlds, Sek Duat "kills off" Zhoom and the hero and takes the lamp, afterwards blasting the ceiling of the Cave of Wanders and causing a cave-in just in case they were to miraculously climb back up... only for the Dreamdust to take effect and switch places between the lamp and a rock causing him to think he had won.
Hero: What's his deal? Zhoom: I slipped him the Dreamdust. Sek Duat probably thinks he killed us and got the lamp. Hero: Pffff. As if.
inFamous if played as an evil Cole. By the end of the game, Cole is the strongest one left alive in Empire City, the place has fallen further in to chaos, he is at least partially allied with one of the City's main gangs, and he announces that the remaining population are his playthings.
And then came inFamous 2. Who cares about a little sociopathic fun and games when it turns out the Ray Plague can only be cured in Conduits by activating them (whether explosively or by The Beast) or cured in humanity by activating the Conduit-killing Ray Field Inhibitor. Guess on which side Evil Cole falls in this Genocide Dilemma.
Played with in that at the end of the sixth and 'final' campaign, the evil plot the Bad Guy had been spending three of the previous campaigns setting up is stopped. It is just that there is a seventh, 'secret' campaign, with the Bad Guy having come up with a new evil plot...
At the end of Crackdown, the Agent has succeeded in dismantling the three gangs ruthlessly oppressing Pacific City, only for Mission Control to reveal that it was all a Government Conspiracy. They let the city deteriorate into anarchy and violence, for the express purpose of allowing them to establish total control over the populace.
On multiple occasions the hero of Fallout 1 is given the option to voluntarily surrender to the Master's army and reveal the location of Vault 13. At this point the "bad" ending immediately triggers, showing a cutscene of your character being dipped in FEV and the Vault being overrun by Super Mutants. It's implied that this would have eventually led to the obliteration of human civilization on the West Coast, at least until the arrival of the Enclave several decades later.
Momo's Muramasa blade ending of Muramasa: The Demon Blade has Jinkuro near death but now back in time before he ended up in Momohime's body. With the knowledge from his time during the game, he manages to pick a better time to take the body of her fiance and ends up becoming her husband. Granted this is debatable because of the Black and Gray Morality, but Jinkoru is still pretty self centered and will kill anyone who gets in his way, now he just has a Morality Chain.
The World Ends with You is a strange example. Turns out that Joshua was the Composer and was planning to destroy Shibuya, possibly the world. Neku had ended up being Joshua's proxy in a game he had with the supposed Big Bad. Kitaniji was trying to save Shibuya through an Assimilation Plot while Neku was used to defeat him to win for Joshua. The interesting part is that Joshua has a Heel–Face Turn. He taught Neku a lot about other people during their week together, but Neku taught him a lot as well, cemented when he couldn't pull the trigger on Joshua, despite knowing how he was used. As a result Neku is a better person and alive again with his friends while Joshua allows things to continue as they did before.
In the Mass Effect 3 Extended Cut, you're given the option to refuse the Catalyst's choices. If you do, the Reapers destroy the entire galactic fleet and go on to harvest the galaxy like all the other times.
Though it is heavily implied that the next cycle is able to stop the Reapers thanks to the information in Liara's time capsules.
In Sonic Riders, Dr. Eggman wins the final race and technically beats Sonic. However, the treasure he sought out turns out to be just a carpet, making the victory empty for Eggman.
In Sonic the Hedgehog (2006), Mephiles succeeds in his plan to kill Sonic, causing Iblis to escape from Princess Elise so he can merge with it to become Solaris. Fortunately, everyone's able to revive Sonic and hit the Reset Button to stop Solaris from destroying all of creation.
Wizard101 has a shocking example considering its target audience. Morganthe uses the magic of Celestia to control the ancient comet Xibalba so it would crash into Azteca. After defeating the minion she leaves to play with you, the entire world of Azteca has shards of ice from Xibalba crashing into it and your main guild for the world can hope that maybe some might survive and to use the tale of their destruction to inspire the Light. This comes as a huge shock since although the arc villain may have completed their goal in most previous worlds, never had the villain caused much a permanent effect on the world after the player left.
Chimera Beast: Technically, both endings. The "Bad Ending" has the Villain Protagonistdestroy the solar system. The "Good Ending" has you killed by the Final Boss and this leads to a win for the ecosystem you were trying to destroy.
Monkey Island 2: LeChuck's Revenge features a rather morbid ending. Even though it's been retconned, the ending at the time shown us that Guybrush was cursed by LeChuck to imagine he is a child at an amusement park, while LeChuck looks sinisterly with glowing eyes. Elaine is standing above the hole waiting for possibly an eternity for her true love who will never wake up from his curse.
Galactic Civilizations II: Dark Avatar reveals that GalCiv 2 ended with the Drengin Empire conquering a good and a neutral race and pushed humanity back to Earth, encasing it in an impenetrable shield. Then it got worse. The Dread Lords convince one of the largest Drengin clans, the Korath Clan, to eliminate any non-Drengin in the galaxy, and they proceed to wipe out two of the previously-playable races.
Which is almost exactly the backstory of Star Control II: The Alliance of Free Stars lost the war with the Ur-Quan Hierarchy, and the remnants of humanity are stuck on Earth, encased in an impenetrable Slave Shield. A branch of the Ur-Quans, the Kohr-Ah, are preparing to embark on a campaign to eliminate any non-Ur-Quan in the galaxy. If the player takes too long, this campaign will actually begin and many of the alien races (including humanity) will be exterminated.
Strangely subverted in Anarchy Reigns. After the Final Boss, Nikolai has been defeated, Jack stands over him, ready to cleave him in two. Nikolai then suddenly comes back to life and impales Jack, before doing the same to Leo, killing the pair of them. He then proceeds to monologue about how he was the winner and that the winner always writes the rules. PSYCHE, Nikolai was just daydreaming before Jack diagonally bisects him.
Sonic Chronicles: The Dark Brotherhood: Cliffhanger + Executive Meddling= The Bad Guy Wins. Before you're allowed to think that Sonic and friends are doomed, the game is set up with a cliffhanger, and it's implied that a sequel is on the way to keep Eggman away from a victory. But this was never to be- after the game's release, BioWare was purchased by EA. BioWare's handheld division was split up by EA- of course- and, although a sequel was penned, there is no plans for it to ever enter production. So this is a case of an accidental Downer Ending in a series renowned for its positivity. Way to freaking go, EA...
Slender and Slender: The Arrival. The first game ends with The Slender Man finding you and your camera freaking out with his faceless features hanging on the screen. The second is far worse. Depending on which ending you get, you still lose. One ending has the player locked in a room with a rotting corpse and a tape recorder on the ground. The recording has two people crying hysterically and uttering apologies before their presumed death. Once the recording ends, the door bursts open and the masked person attacks and kills you. If you think that ending was bad, another has The Slender Man throwing the player off the tower while they're still conscious and the camera battery flashes before they die. Either way, The Slender Man wins and you die.
In Calm Time, the killer (AKA the Player Character) manages to kill off all of the people they invited to their Nasty Party in a countryside house, and aside from a ghost haunting them and setting Jump Scares from time to time, they get away with it.
In the Star Wars Episode III game, after the player has completed the story missions, an alternate final level is revealed, where the player takes on the role of Anakin Skywalker (Darth Vader) fighting Obi-Wan Kenobi. When the player completes this level, there is a cutscene where Anakin jumps from the moving lava river platform, lands behind Obi-Wan and runs him through with his lightsaber. He then goes back to the landing platform, where he meets with Emperor Palpatine, flanked by a number of clone troopers. Palpatine then says, "Excellent work, my apprentice. There are non left to oppose us. The galaxy is ours now." and hands Anakin a new lightsaber. Anakin activates it and runs the emperor through. The troopers barely respond, only raising their guns a little, but stand down as Anakin says to them, "No... the galaxy belongs to me...!"
In the Endor DLC of Star Wars: The Force Unleashed II, the evil clone of Starkiller, stops the Rebel strike force from destroying the shield generator protecting the second Death Star, and also kills Leia. Palpatine then declares this the end of the Rebellion.
Palpatine:[chuckles evilly] A great day, Lord Vader. Today marks the death of the Rebellion... and the birth of a new era of peace... for the Empire.
Phoenotopia has this, although it's not the Kobolds who win - it's actually the Galactic Federation. Billy is bound to curb-stomp them with the Phoenix Weapons whenever he deems it appropriate, but he's arguably even worse.
In the various Shin Megami Tensei games, choosing to side with Law or Chaos can get you something like this. Generally, a Law or Chaos ending will permanently solve the given game's conflict, but at a steep cost that the game makes it clear is very much not worth it (which tends to be humanity's free will in Law and its peace in Chaos).
Despite losing pretty much everything in the process, the Bonne family actually does succeed in stealing the treasure (a massive Refractor) they were seeking in Kattelox Island. It's also heavily implied in the sequel that said treasure is literally the only reason they were able to get back on their feet.
Undertale has some fun with this. The first time you try to go for the Neutral ending, Flowey shows up after the Final Boss to seize control of the six human souls and ascend to godhood before crashing the game. While the game does continue after that and the player does ultimately beat him, his Ripple Effect-Proof Memory ensures that he will always keep coming back on every playthrough to deny the player the happy ending they want — he's savvy enough not to try fighting you again, since he lost the first time when the human souls rebelled against his control, and since they also have Ripple Effect-Proof Memory he knows they'd just do it again, but he still takes them away from you and ensures you can't use their power to cross the barrier. And don't think you can stop him by killing him after the boss fight — his death looks ripple-proof at first, but if you defeat Asgore again he'll reveal that, just like anyone else in this game, he got better when you reloaded to before you killed him.
The Genocide route has a completely different villain winning, and possibly one of the biggest villainous victories in all of fiction. By completing the Genocide route, the player fulfills the First Child's desire to kill everyone and everything in the game, culminating in the First Child killing the last two surviving characters themselves and then "killing" the player before erasing the entire world and once again crashing the game. The player can go back, only to find that the game is reduced to a black void, and in order to do anything else they player has to sell their soul to the First Child, which taints the rest of the game in such a way that, no matter what the player does, even if they achieve the Golden Ending, the First Child will always win in the end. FOREVER.Unless you delete that innocuous-looking system_information_963 file in your save folder.
In Swamp Sim, Even after you collect all eight onions, Sherk pops out of nowhere and kills you.
Fire Emblem Fates: In the Conquest, even though you eventually kill Garon at the end of that route to change your misguided kingdom, Nohr, from within, he has already achieved his goal of conquering Hoshido.
Fire Emblem Jugdral: After you defeat the last boss in Chapter 5 of Genealogy of the Holy War, and Sigurd and his army are escorted to your castle to be met by your entire army being betrayed by the person who you thought was your friend. Sigurd himself is executed by Lord Alvis and your army scatters to the wind with your units living out the rest of the lives in hiding or dying from one cause or another. In the 17 years following the massacre, the various countries that you helped liberate from cruel rulers have become oppressive empires and the citizens are essentially slaves. Chapter 6 begins with Sigurd's son leading a liberation army comprised of children from the men and women who fought in Sigurd's army. It's a partial example because you eventually win in the end; it just takes nearly two decades before you can fix everything.
Shantae: Risky's Revenge ends with, well, the villain Risky getting her revenge by stripping Shantae of her genie half.