I think Batman's ideals ultimately prevailed in TDK, but at the cost of Bruce Wayne's soul- which ends up getting left to rot. Which doesn't happen immediately, it's a gradual process (the energy project, etc.).

I think it's interesting how it can be argued both ways who actually "won" in TDK though.

I recently re-watched TDK again and there are more allusions to what happens to Batman in TDKR than I thought, specifically Joker's claim that Batman will be cast out when he's not needed anymore. You could argue that Bruce comes to believe this along with Harvey's "live long enough to see yourself become the villain" line and takes the opportunity to cast himself out on his own means.

I would argue that Joker wins by the end of TDK. Joker remarks that Batman is truly incorruptible in their last meeting but I would argue because of what happened to Dent, Joker had a hand in forcing Batman to corrupt the Batman symbol. Although their intentions are good, Batman and Gordon become corrupt, which is tragic because corruption is what they were trying to fight.

It's a really compelling ending but in all seriousness, I think it would be easy to spin Dent's story to the public as a victim of the Joker, which is how we see it as audience members.