Other than the fact that they could have just negotiated an extra film for him, they could easily solve this with story.
For instance, Civil War could end with Cap quitting and going off the grid. Infinity Wars: Part 1 could have Bucky holding the shield. At the end of part one the team is shattered with Thor falling. So Tony has to go and find Cap and make peace because he is the only person Tony can think of that can wield the hammer.
I'm like 99% sure Cap "dies" (these are comic books) in Civil War. Evans has said he wants to direct and is done doing movies; and I believe Cap 3 was his last contracted movie. I suspect if Evans is up for Avengers 3, shenanigans with Strange & Thanos lead to him being resurrected. But pretty sure Cap will bite the bullet.
Assuming typical Whedon level killing of characters; I am guessing Jane Foster, Pepper Potts, and Rhodes don't survive Avengers 2, and he may kill some combination of Hawkeye / Black Widow / Fury as well. Thor will leave Earth (with Jane dead) and Iron Man will be super done with all the things. Hulk goes into full blown hiding (terrified of his destructive potential), and Cap is done with everyone.