I think TDK, even with its missteps, was far more epic and impressive than IM. IM is definitely more fun than TDK, and I would probably stick IM in the DVD/bluray player when I want to just relax and watch something light, but I respect TDK more as a film and for the risks the team took with it. IM was a very typical superhero movie, but TDK (almost) transcends the genre and can be viewed as a tragic crime drama. Seriously, take out Bats, remove the Joker's makeup, do a little rewriting to remove Batman related plots, and tone down of the action, and Gordon and Dent could be made the main characters of the film without changing the flow and story of the film. Its amazing how they got Batman to fit perfectly in that kind of a movie.
But yes, I love both films for different reasons, but TDK wins out by a little bit.