The underlying principle of all series on the idealistic end of the Sliding Scale of Idealism Versus Cynicism: the good guys will always win in the end. Most of the drama in the show comes from the sacrifices they will have to make to this end, and sometimes from their lack of faith in this principle, though usually The Hero, The Love Freak, The Mentor or Messianic Archetype will be there to serve as an endless supply of optimism for the ultimate victory of their cause.
May come as a package deal with Right Makes Might, but not necessarily. If the show is idealistic enough or targeted to a very young audience, Justice Will Prevail without a single drop of blood being shed — indeed, justice usually prevails with the aid of karma, and the heroes won't actually have to beat anyone into submission. If its cynical enough, the word 'justice' becomes propaganda that both sides of a conflict use to justify violent/controversial/misc shade of grey actions.
Compare For Great Justice, when this is explicitly stated in the opening, narration, or cutscenes. Contrast Concepts Are Cheap, for when this is just thrown in dialog, without actually meaning much.
In the Marineford arc, the war between Whitebeard (the commander of the world's most powerful pirate fleet) and the Marines brings the theme of "which kind of justice?" to the forefront.
This is a pretty blasphemous statement to make in a shonen manga, where clearly defined clashes between good and evil are usually major themes. So when a character basically says that good and evil are just labels the winning side in a conflict uses to justify its actions, it's a moment to take note of as this is rarely seen in a shounen genre.
Said right after "I am Justice" by characters in Death Note. The audience can be sure that Justice will prevail. The question is only: whose brand of justice?
Amelia in Slayers often makes speeches along these lines, but isn't taken very seriously. One particularly warped bit of reasoning on her part comes when trying to figure out whether Lina or another individual is the guilty party:
Amelia: "Justice always prevails! Therefore, whichever of you survives must be the good guy! FIREBALL!"
Oh, and technically, both sides survive that blast. Whether this has implications as to her philosophy... well....
As time goes on, she seems to realise how silly she looks and does this less often, though she can still pump out the Hot Blood for, say, her father or the "Senile Sentai Squad".
The Student Council President from Onidere is practically invulnerable as long as he believes he is fighting for justice. He even has a statue of some... thing... that he refers to as the 'statue of justice' and is commonly seen praying to it and making sure it stays clean.
Lampshaded in Fullmetal Alchemist, where Maria Ross, during a broadcast, claimed that Roy Mustang and his party were specifically fighting for justice. Some comments from the less gullible flock:
"'Justice' was an excellent word choice. The people will eat that up."
"Justice is about as vague word as there is."
"Please, it was great. It has a great ring to it. 'Justice'. It's beautiful."
"Yup. Whoever uses the word first has the advantage."
In Machine Robo: Revenge of the Chronos, this is the whole basis of Rom Stoll's speeches, emphasizing to the villains that justice always prevails, and that they don't deserve to know his name for being so evil.
Bleach: This is Kaname Tosen's schtick. He claims to follow the path to justice despite betraying Soul Society to a would be Omnicidal Maniac. It turns out he did so to avenge his long dead friend who was killed by a Shinigami who went unpunished. Tosen notes that forgiving the Shinigami would be beautiful and virtuous, but it wouldn't be Just.
Fairy Tail: Fukuro loudly talks like he's a superhero, claiming that he's a Knight of Justice who will destroy the forces of evil, and referring to his opponents as evildoers. He does this even though he's an assassin who eats people alive.
Name a superhero. If they've been around for more than a year, they've probably said it or some variation. Some are more driven by the idea than others, though.
Inverted in a Justice League of America storyline about a villain named Prometheus, who is obsessed with the eradication of justice. His plan to destroy the League involves disguising himself as a superhero named Retro, whose catch phrase is "here comes justice!" After disabling half the League and revealing his true identity, Prometheus repeats the phrase one more time, this time with malicious sarcasm.
In the Miss Marple book A Pocket Full of Rye, Helen McKenezie insists that the man responsible for her husband's death will be punished and that, "No question is ever settled until it is settled right." She claims to be quoting Kipling but doesn't give a source (it's Ella Wheeler Wilcox, Poems of Pleasure).
The stable The Shield claims that they are on a mission to bring WWE's evildoers to justice, but everybody knows this is a lie because all they do is ambush the faces and give them No Holds Barred Beatdowns, while helping heels win. Or more specifically, they see the fans dictating the direction of the company as an injustice, everyone else sees that as "logical business". This changed however when Triple H's Authority targeted the semiretired Jerry Lawler, which they saw as an even greater injustice, turning them into the baby faces they once despised.
Declared by Leva Bates, who felt opposing whatever Portia Perez's designs for the SHINE promotion might be was her civic duty as a superhero. It was more "stand for right" than "justice" but same idea.
Much more subtly implied by Daffney after Mercedes Martinez vowed to eliminate all the members of Daffney's All Star Squad, one by one.
In William Shakespeare's plays, innocent people are likely to die, but villains are practically certain to get punished. "Truth will come to light; murder cannot be hid long; a man's son may, but in the end truth will out." (The Merchant of Venice, act 2 scene 2)
Inverted in Guilty Gear, where keeping Justice from prevailing is the entire goal of the game.
But played straight in BlazBlue in form of Bang Shishigami. Even if he's usually the Butt Monkey.
Xianghua of Soul Calibur plays with this trope, as this is one of her win quotes, but she adds a "...just kidding!" to the end of it. Interesting, as she is the one character who can wield the eponymous holy sword in its true form.
It's implied that the fact that she doesn't take justice so seriously — but just practices it as a matter of course, without getting high and mighty — is exactly why she is the purest character in the lineup.
Xianghua's daughter, Leixia, has inherited this trait from her mother: she concludes her Critical Edge attack with an energetic "Justice will prevail!"
One of the more frequently recited Dwarven Vows in Tales of Symphonia is dwarven vow number seven; "Justice and love will always win!" (Or "goodness and love", depending on whether you ask Lloyd or Colette). Despite his idealism, Lloyd cannot hear or recite this line without pointing out how cheesy it sounds.
The line "Justice will prevail" is in the sequel. It is to note that the villains of Dawn of the New World seem to think "justice" is what they're trying to achieve.
Lloyd: Don't even start spewing the word "justice"!
In Disgaea, this is literally the catchphrase of CAPTAIN GORDON, DEFENDER OF EARTH! Can be made especially hilarious when he yells it while fighting humans and angels.
Slightly more cynical version from Metroid Prime 3, in which Rundas comes up with this line when the hunters are all arguing with one another: "Hey, relax. We're the good guys, remember? Justice will prevail, and all that stuff. Right, Samus?"
One of the few characters to ever beat Calypso at his own game in Twisted Metal is Agent Shepard in Head-On. He doesn't make a wish. He doesn't do anything stupid. He wins the tournament, gets out of his car, and arrests Calypso outright.
Subverted by Dragon Age II, as the same Justice, corrupted to Vengeance, seems a bit cynical about himself prevailing at all. And in the best-case ending of the game, no one can say that Justice was done.
In the Samurai Warriors series, Kanetsugu Naoe's character focuses solely on justice, bordering Large Ham territories. Most of his lines are about how sheer force of will can beat all odds and how "another has been slain in the name of JUSTICE!"
Tyrael of the Diablo series wants justice to be done into Sanctuary, and, after three games, succeeds.
In Megaman And Bass, this turns out to be King's motivation. After being defeated, he laments "Why won't justice prevail?".
Mega Man Powered Up portrays Fire Man as a Hot-Blooded and kind of loopy self-proclaimed robot hero, even when he's been reprogrammed by Dr. Wily—apparently there are some things mind control can't change. He insists that he's on the side of good and that justice always wins, and he manages to be one of the most entertaining things in the game because of it.
MUGEN fighting game Shades Of Manhattan 2 features this quote if you pit idealistic Anti-Villain Apollo (who says the trope name verbatim) against Detective Garret Laurel. Laurel's response is to flash his badge and go "Justice? You're looking at justice, kid."