Mmm it's pretty common in a lot of anime. I don't know if I can think of a shonen action anime, or sports anime off the top of my head that doesn't have this theme to an extent.
That being said, I don't think all idealistic anime and so-called gritty anime are as you describe. Tengen Toppa Gurren Lagann is a very idealistic show, but a surprising amount of good guys are killed, and the bad guys aren't really pure evil.
And a show like Now and there, Here and there, which is quite dark and gritty in the way it treats its subject matter (though children being exploited is kind of a hard topic to make funny without being tasteless)
does ultimately have a hopeful message.