If it was only about deaths, then yes, Ukraine would eventually run out of soldiers. However, there are two other factors that can impact the fighting force - POWs and medical care for wounded.
When a POW is captured, they are removed from the battlefield and do not return (unless you have a prisoner swap). In the early phases of the war, there would have been more Ukrainian POWs than Russian POWs as the Russians were on the offensive. Now that defensive positions have been established, it swings the other way - we would expect more Russian POWs due to the counteroffensive resulting in more Russian attrition and surrender. According to reports, we also know that more than 16,000 Russians surrendered via the "I Want to Live" hotline project from Sep 2022 - Apr 2023. There would be a much higher number who surrender directly on the battlefield.
The differences in medical care would also be significant. When a Russian soldier is wounded, they have to rely on medical care from their nearest military outpost and they are limited to Russian medical supplies (which could have quality issues). When a Ukrainian soldier is wounded, they already have the home field advantage of having faster access to healthcare, but they also have medical supplies provided by the entire Western world and countless volunteers or donors who are committed to helping a Ukrainian soldier recover and possibly return to the battlefield in good condition.
When you add these additional factors into the mix, the ratio of Ukrainian soldiers to Russian soldiers likely becomes closer.