When it comes to foreshadowing, the MCU is pretty much the don. Things that are seeded years before in stand-alone movies end up playing a major part in later event movies and small lines of dialogue end up gaining vastly more meaning down the line. It's sort of their thing.
We already know that Doctor Strange's death doesn't last because of a single line clarifying the rules of death in his solo movie and there's that whole "end game" line from Infinity War echoing Avengers: Age Of Ultron. In other words, it's not unprecedented for that sort of seeding to mean more than it seems in Marvel movies.
So why mention it now? Well, because another older line from an MCU movie might hold the key to a big moment in Avengers 4. Namely, the long-expected death of Captain America, which will SURELY form part of the upcoming sequel's emotional armoury. It fits his story arc for him to fall valiantly in combat, probably while standing for everything that defines humanity: resilience, spirit, hope... It's bound to be pretty devastating.
But will it last?
In the comics, Cap is killed at the end of Civil War, only for it to be revealed that he was actually just teleported into another dimension between time and space (this is a HUGE over-simplification, but diving into comics story mechanics is a fool's errand sometimes). So could the MCU's Cap follow that same lead? There's certainly a big hint.
Back in Avengers: Age Of Ultron - the film that actually first really confirms that Thanos' is coming AND that he's a far bigger threat than anything seen before - Joss Whedon wrote one of the most Joss Whedon of lines ever for Cap's inspirational speech during Ultron's attack on Sokovia. He says "it you get hurt, hurt 'em back. You get killed... walk it off."
It might seem like a flippant, throwaway line, but they don't really exist in the MCU if you pay enough attention. Is this an early hint that Cap is going to be killed but will come back from the dead? How clever would that be?
Fundamentally, Infinity War (and its aftermath) are something of a propaganda war because there is genuinely SOME logic in Thanos snapping away half of existence. Some commentators have even said that he was in the right and isn't that much of a bad guy (despite what the Russos have said about his messiah complex), so the Avengers will actually have to fight to convince some people that reversing the snap is genuinely the right thing to do.
The best way to do that is to establish Captain America as the heroic, tragic figure he is in Infinity Gauntlet, standing up to Thanos even as it looks like failure is inevitable. His last act of valiance should provide the kindling to humanity's rise to defeat the Mad Titan (or whoever outlives Cap anyway).
But that still doesn't mean that Cap shouldn't be given a reprieve as he was in the comics in the wake of the Civil War comic book event. It wouldn't rob too much from his dramatic story - particularly given the repeated affirmation of his resilience in that "I can do this all day" mantra that runs through the MCU. If he comes back from the "dead", that return is the ultimate expression of him being able to go all day. You don't get much more defiant of defeat than by simply not dying when you're supposed to...