Pretty much any good stand alone film is going to be better than the avengers. Avengers relies on lore from multiple previous movies and characters. The film is limited in the story it can tell because of multiple focus characters and conflicts. Where as TDK has a really tight focus on two or three characters.
It's the same reason Winter Soldier was better than the Avengers, it's just a tighter more focused film.
Also Heath Ledger's Joker trumps any acting performance in the Avengers, despite it being loaded with talent.