Universal healthcare and UBI aren't going to magically make a town economically viable. It'll just result in other places subsidizing some people to live in that place and sit on their asses mostly. It might work out if lots of such people congregate in one place, which will turn it back into an economically viable location, with people starting businesses (since UBI does help entrepreneurialism after all), but if it's just some little village, it'll just be some people doing little to nothing for extra money and complaining that there's no grocery stores there, because even with 100 people with UBI, that's still not enough to sustain a business.
Many of these towns just need to shut down and become ghost towns. Whatever industry that used to sustain them decades ago is gone now, so they have no more reason to exist. This isn't new: the Western US states are full of actual "ghost towns" from the late 1800s and early 1900s, most of which died out because the nearby mine got tapped out and shut down. The towns died, and the people actually (unlike these days) accepted reality, and packed up and moved out. All that's left now is usually building foundations, though some places have some collapsed buildings left.
Conservative small-town people in the US these days are really a strange lot. They whine about "socialism", but then they complain about their little town dying out, but refuse to do anything to improve their situation such as moving to a city for work, and then seem to want a government handout.
I'll also add that universal healthcare isn't going to magically bring hospitals to rural areas. Lots of rural people are so far away from medical facilities that they're basically screwed if they have any problems that require help quickly. Hospitals require a lot of money, and a lot of highly-trained staff; universal healthcare isn't going to make all these people suddenly want to relocate to some small town.