There is good research to support that eating high protein without exercise can preserve muscle mass. Some folks even increased lean mass.
Through muscle protein synthesis, which you can usually trigger by eating 30g of protein 3 times a day, your lean mass can repair yourself.
We do recommend exercising for other health reasons, such as bone density. You don’t have to go to a gym to strength train. You can fit it in throughout your day in your home by doing bodyweight exercises or exercise bands.