BMI doesn't work like that, it just tells you if you're  basically too dense for your height with no distinction between fat/muscle. BMI is also a tool for roughly assessing an individual against a (healthy) population norm and it's "accurate enough for government work". If you're basically becoming skinny fat, eat more protein (~2g/kg target BW tends to be more than enough) and do some basic resistance training with progressive overload. Lunges, push ups and chin ups with a back pack you put more stuff in over time would be sufficient if you don't have access to a gym. Muscle mass disappears with 3 main things age (humans become progressively more protein resistant*), protein insufficiency (not eating at least 1g/lb of lean mass per day) and lack of tension/use. You can do something about the last two. *This is more of a digestion thing, plenty of studies giving older folks whey/casein before bed having net positive effects on rate of protein synthesis into LBM.