As someone pointed out above, the Joker apparently had 30 minutes of screen time in TDK. Add the screentime for the mobsters, for Lau, for Dent, and that really adds up, it's a lot of time not spent on Batman.
Only if Batman was completely absent from scenes featuring those characters, and had no story relating to any of them, which was clearly not the case. He had numerous key scenes with them which he was pivotal to, and were part of his character development, and the main story.
The focus was still very much on Batman, and the story was all about the effects of Batman and his choices on Gotham City. His presence basically opened a whole can of worms, the biggest one being the Joker. He then misguidedly thinks Dent would be a good replacement for Batman, and that has even bigger disastrous consequences. TDK was very much an eye opening learning curve for Batman.
He learns what his limits are, what Batman can endure both personally and symbolically, he learns about the nature of criminals like the Joker (and actually learns from his encounter with the Joker to face him again, like by the finale he sees right through the Prewitt building set up as not being what it seems - "It's not that simple. With the Joker it never is"). And yes, his selfless sacrifice at the end when he learns Batman can be what ever Gotham needs him to be. Compare that to Bruce at the beginning of the movie who arrogantly thinks Batman has no limits. Bruce's growth in this movie was learning what they are, what he can and cannot endure, and learning about the terrible nature of freaks like the Joker whom are a reaction to his presence in Gotham just like the copycats. TDK was a real eye opener for Bruce and what exactly the effects of Batman are on himself and on Gotham.
He had so many stand out scenes that often get underrated. His take down of Scarecrow and the imposter Batmen in the parking garage. Abducting Lau from China. Kicking ass in Maroni's club and dropping Maroni off the fire escape. The whole Joker truck chase he was bad ass with many cool moments like taking out the garbage truck, birth of the Bat-Pod, and flipping over Joker's truck. The Prewitt building scene is probably the coolest Batman has ever been on film taking out two SWAT teams, Joker's men, and protecting the hostages, too.
There was a great mix of funny and serious Bruce Wayne scenes, too, like the aftermath of Rachel's death where he's quietly mourning her with Alfred - they did a great mirror image of the childhood Bruce mourning his parents there where Alfred comes in, says something about food, Bruce ignores him, Alfred says "Very well" and goes to leave and then Bruce calls him back. All the playboy Bruce stuff was gold. Seeing Bruce use the daylight hours effectively as Bruce by staking out Loeb's funeral, and following Gordon and Reese and having Alfred run a check on all the Cops he recognizes (love that Bruce knows many of the Cops by name) etc.
So yeah I've never agreed with the assertion that Batman was not the focus or not much time was spent on him in TDK. It's not what the movie showed.
Comparing again with TDK, the Joker wins some battles against Batman in TDK. He succeeds in turning Dent for example. He succeeds in blowing up the prison. In contrast, Ultron (and Hydra before him) loses every single encounter with the Avengers in Ultron. He doesn't succeed in turning the vision the way the joker turned Dent. That's not what the movie is about. AoU is a celebration of the Avengers. They win every encounter, because they're the Avengers. Fist pump !
Which to me makes for a less interesting movie. I know Batman and his world are darker in nature than the likes of The Avengers, but seeing the hero win at a great cost, both heroically and emotionally, makes for the much better story, IMO. Yes Joker got to blow up hospitals, kill Rachel, destroy Dent, turn Gotham into anarchy, force Batman into destroying his heroic reputation etc. Because he's the Joker. He's Batman's arch nemesis. His deadliest villain. If there had not been chaos, losses, scars and sacrifices from Batman's bout with the Joker then Nolan would have dropped the ball big time. Nobody has damaged Batman more than Joker, and Nolan nailed that and much more.
I think the aforementioned lack of punch and menace from Ultron as a villain is one of the reasons why many fans found him to be disappointing, because as you said he really didn't achieve much. I know I sure found that a letdown, along with his jokey light personality. Even Loki managed to knock SHIELD out of the sky. It's safe to say Loki is Marvel's most popular villain.
Marvel's Achilles heel has always been the villains, IMO.