Actually, Riri was seen before Civil War II. Her First Appearance was in May 2016. She didn't become Ironheart until November of that year.
Yes, Miles and Khamala were created to fill vacancies left by their predecessors...and both took those mantles to pay tribute to the aforementioned predecessors. In the case of Miles...it would have seriously weakened the effect of Peter dying if his replacement had already been teed up. In the case of Khamala...the mantle of Ms. Marvel had been sitting idle for a year before Khamala was introduced.