WS handles this best of all: the humour is sparsely sprinkled throughout, is situational and/or character related, and never feels like it is obligatory to laugh at it. It also never takes away from the gravity, either of the scene or of the whole film.
I get the sense some movies say to us: "Hey guys! Enjoying the movie? Just in case you were getting too serious, here's one or two quips for ya!" Ant-Man comes to mind: "Absolutely. My days of breaking into places and stealing **** are over." "I want you to break into a place and steal some ****." "Makes sense." Especially that last reply from Scott - we didn't need it and it's a clear forced attempt at lightening some serious dialogue which would otherwise help us connect more deeply with the characters.
The worst offender of this apart from TDW is easily Doctor Strange. There are some great character and dialogue moments throughout the film, but we never get to appreciate and absorb them because, we're meant to be having fun!
If the Russos and Co flow their CW template, which is very balanced, Infinity War should be just fine on that score. Thank goodness Whedon's not doing it.