The 1954 Comics Code required good to win, so this trope is rare in American comics. Only underground and foreign comics would bypass this rule. The Code has gone out of favor since 2000, so recent comics do not have to heed to it either.
6. In every instance good shall triumph over evil and the criminal punished for his misdeeds.
The Clone Saga ends with Spider-Man's clone that he loves like a brother Ben Reilly being impaled by Spider-Man's nemesis Norman Osborn. Norman had previously killed Peter's girlfriend Gwen Stacy. Ben's last words to Peter are to remind Peter's daughter of her uncle Ben. Of course this is a moot point since Norman already had Mary Jane poisoned and she presumably lost the baby. Ben didn't know that though.
The Vulture (Adrian Toomes) has had an astonishingly high success rate in accomplishing various goals over his career:
Willed himself to health to defeat an usurper who tried to kill him in prison? Check.
Eventually killing the man who betrayed/ruined him financially? Check.
Doctor Octopus essentially won the long game by taking over his body and starting Superior Spider-Man...and to make sure, he made Peter Deader Than Dead by erasing his brain waves in issue 9. But some would say he suffered the greatest loss of all in the end, when he realized he was a failure who had caused more disasters than he ever could have prevented, and restored Peter, deleting himself from existence.
Batman: War Games. A Batfamily member and an ally die along with hundreds and cops and civilians. Black Mask becomes the leader of the unified gangs of Gotham. And it is entirely the Batfamily's fault, to the extent that that incarnation disbands.
This trope is deconstructed at the "Going Sane" comic: After The Joker believes he killed Batman, he decides to become Bored With Insanity, gets a treatment for his skin condition, looks for a job, knows a nice woman and tries to live a new, sane life. Then he learns The Batman survived and it's business as usual...
The backstory of Wanted is that this happened 20 years ago. Also, the outcome of the series itself no matter which side wins.
Surprising for the Silver Age, but this and a side order of Heroic Sacrifice was the fate of the original Doom Patrol. The bad guys gave them a chance of saving their own lives or 14 lives in a fishing village, and the Patrol told them "Bring it on!"
Mister Fear in the "To The Devil, His Due" and "Without Fear" arcs of Daredevil: Not only does he does cause irreparable damage to the hero's life, but his powers only make life in prison a veritable paradise that he can leave at his leisure to once again torment the hero.
Minor example in a Transformers Energon toy pack-in comic. Normally mini-comics packaged with toys are a page or two to advertise the rest of the line. Good guys are minding their own business when the bad guys show. Good guys show off their features while driving bad guys back. The end. In this case, though: Inferno, Prowl, and Landmine find some energon. Megatron shows up. Inferno dramatically combines with Prowl to form... Powerlinx Inferno! Landmine dramatically combines with the parts of his vehicle mode that aren't normally part of his robot mode and becomes... Landmine Brute Mode! And together they... get curbstomped by Megs and his new Terrorcons and are sent scurrying away with their tailpipes between their legs while Megatron laughs at them. The Decepticons take all the energon. The end!
Sin City short stories often end with the bad guys winning. The most well-known example of this is in Daddy's Little Girl where an incestuous father-daughter couple kill the protagonist as a means of foreplay. The main stories play with this trope. Even when the heroes die or their lives are destroyed, the villains suffer great losses as a result or even die themselves.
The short-lived DC comic Ninja Boy ends this way. It sets things up like a typical hero's journey story, with protagonist Nakio trying to become a full ninja and defeat an evil lord. Over the course of the series, he gathers a group of companions and sets out on his quest. But he never even gets close to his goal, and the final issue consists of a showdown between the heroes and a group of henchmen. It's a complete bloodbath, and the heroes all die horrible deaths. The last panel of the series shows a villain kicking the smoldering corpse of his best friend, a Pikachu-like critter, off a cliff. The end leaves a minute spark of hope of survival for Nakio, but it is unlikely that this will ever be picked up upon.
DC had Earth-3 where an evil Justice League called the Crime Syndicate ruled the Earth. But Grant Morrison's JLA Earth-2 version of the Crime Syndicate took this a step further; evil always wins in this universe and the Justice League of our earth along with their heroic Lex Luthor are doomed to failure just as bad guys are doomed to failure in the normal DCU.
The Avengers story "Operation Galactic Storm." The Supreme Intelligence completely masterminds things to get the Shi'ar to hit its own race with a Nega-Bomb in order to reignite the Kree's evolutionary cycle, even though it means killing most of the race. When the team finds out one half led by Iron Man attempts to kill it for causing the genocide, and they seemingly succeed... only for the very last page to reveal that it saw their actions coming a mile away and faked its own death, leaving it free while everyone presumes it to be destroyed.
Sszzaas, the god of betrayal, manages to get his place back as a major god by manipulating all the other 19 gods plus all the characters in the story, thus regaining all the powers he had lost upon his banishment. With this, all of his cultists also get their full powers back, including Nekapeth, the high priest of Sszzaas, who had been working with Arsenal the whole time for this end.
Arsenal, high priest of the god of war, and manipulative father of the female lead manages to get the world's Infinity+1 Sword, which is capable of killing anything with just one slash, this sword being his main objective since years before the story even begins.
Sszzaas: Why do you look at me like that? Can't a major god be in a good mood? After all, it's not always that a great adventure ends with the victory of the villains!◊
Sckhar: Speak for yourselves! I only got screwed in this story!
In Journey into Mystery Kid!Loki manages to save the day against all odds. But his true Arch-EnemyOld!Loki has trapped him in a situation forcing him to choose between letting Mephisto run amuck as the new king of Hell with the Fear Crown Kid!Loki created or saving all of reality by destroying the Fear Crown which can only be done if Kid!Loki allows Old!Loki's memories to overwrite his own, completely erasing Kid!Loki from existence. Kid!Loki chooses the latter, though he takes one last parting shot at Old!Loki, calling him out on his Chronic Villainy.
Death Of The Family ends with The Jokersuccessfully bringing about the metaphorical death of the Bat-Family, breaking or greatly hurting most of Batman's allies' trust in him.
At the end of the Sinestro Corps War storyline in the Green Lantern comics, although Sinestro was defeated in the final battle, he reveals that the whole point of the war was to get the Green Lantern Corps to use lethal force, and he has succeeded.
In Avengers Arena, Not-So-Harmless Villain Arcade managed to succeed in getting several young heroes killed off, escaped punishment, and uploaded what really happened on Murderworld to immortalize himself as a true villain while leaving the survivors broken and jaded.
In "And So My World Ends", one of several stories that is often viewed as marking the line between the Silver Age and Bronze Age, the Justice League arrive on the scene only to discover that Martian Manhunter adversary Commander Blanx has already won, exterminating the whole Martian race, save himself and J'Onn. In the end, the most the League can do is bring him to justice for his crimes.
New Krypton sees General Sam Lane and Lex Luthor successfully trigger a war between New Krypton and Earth, and in the process, render the Kryptonians all but extinct. While Lane commits suicide in the aftermath, Luthor is not even punished, and is hailed as a hero for his actions, regaining control of LexCorp and being pardoned for all his sins in the process.
Brother Blood broke the Teen Titans' winning streak in the 1980s by arranging things so that their attack on his citadel only gave his cult credibility in the eyes of the world, ending with him framing Cyborg for his own murder while his followers wait patiently for his return, and bam, that was the end of that story arc.