I believe Mercedes will never be caught unless some team decides to put insane amount of money into their cars. Also remember these are hundreds of millions of dollars worth of projects, to even have a F1 car is an insane idea, nobody should go into this thinking profits because you are going to bleed out cash like nothing else, hell it is going to hurt business more than it helps them. All the fame and power and recognition and advertisement you get will not be covered considering how much money you lose.
However, let's assume some crazy boss or CEO goes insane and decides to spend double what Mercedes spends, at that point any team can catch up to Mercedes, all they need is a whole new huge team that can work on the next car, and a team that works on even further while you keep on working on current car all different teams. That is literally the only thing that you can do, there is no other answer to Mercedes other than spend more than them.
unfortunately with the current formula 1 rules, no one can spend a lot of money, by regulation, in 2021 it is possible to spend only 145 million dollars per season (excluding salaries).
Mercedes is way ahead with the engine and hybrid side, it has spent a lot on research in previous years. With the new 2021 rules, however, it could begin to lose competitiveness, we also remember the Ferrari of the Schumacher era, it seemed invincible, then it never won again