OP, you ask a very valid question and I can see why you are concerned. It is a really tough question. This sort of thing worries me too. I think there isn’t a clear answer. I can only tell you my experience.
It is tough because sometimes people begin by withdrawing for mental health reasons and then feel they don’t want to resume relations again so go full on ghost.
In my experience someone who cares about you will give a very natural verbal indication that they are having problems. I know there’s always the danger that a friend is so afflicted they keep their problems 100% secret, but I think that’s not common. More often than not people will say things that indicate they are not feeling great. Or at the very least they will give you some small responses.
Someone who is tolerating you but is too “nice” to be direct about it will say things that sound phony or like someone has been advising them. e.g. My phone is broken, I’m very busy at work etc …
Sadly, there are people who will go out of their way to be nice to others but then when they are feeling rough they lose energy for it because being nice was about them and not about actually feeling a bond with you. So in a case like that, they are having a hard time but they are also ghosting.
Unfortunately, I think we have to be a little bit hard hearted. Unless they are so severely unwell that they are incapable of communication, everyone is capable of giving a friend some indication that they still want to know them.
When I feel rough, I don’t want to lose my friends so I certainly won’t ignore them when they text me. But the people I didn’t really ever have much of a friendship with in the first place, I don’t go out of my way to keep in touch with them.