You appear to be assuming that even if the value of the property does not rise in the future, it will at least remain. Have you considered that you may never be able to sell such a house for even 20k in the future? As you noted, the population in that area seems to be low, and aging, meaning that in 5 years, perhaps there is even less demand than what there is right now.
Further, you may have additional operating costs for the house, even if you don't live there / rent it out. For example - utility costs which may be necessary, maintenance costs when something gets damaged in the whether, property taxes, insurance, etc.
The benefits which you have listed ('peace of mind' and 'possible rise in value') are dubious. If I owned a house in some remote area, I would now have to worry about possible vandalism, weather damage, missed tax payments, missed financial opportunities due to cash shortage, etc etc. The only peace of mind is against the fear that all of society breaks down and you have a shack to sleep in. Is that really a risk you fear? In a not-so-terrible catastrophe, for example you lose your current job, would it help you to move away to somewhere where there is no work? And the way you've laid it out, a 'rise in value' seems to be a pure gamble on what might happen in the future. This is not a good way to make investment choices.
What if in 3 years you get married, and want to move, but don't have the down payment for the house you actually want to live in?
Real estate is very 'illiquid', which means it is hard to convert to cash. This would not be emergency savings for you, and would be quite risky to hold.
I live in the U.S. so things may be different, but:
You say you can't live in the house now. So it would either be sitting vacant or you would have to rent it out.
If it's vacant, then it could be damaged by a storm, or the pipes could freeze in the winter and break and flood the place, or vandals could do major damage, etc. There are lots of things that if you were there, you could prevent or fix with minimal effort, but if no one is there, if it goes on for weeks with no one knowing, could do major damage. My parents had a summer home for a while and one day while they weren't there thieves broke in and stole all the appliances and everything else they could carry off. Here in the U.S. insurance on vacant houses costs way more than insurance on occupied houses, because the insurance companies know this.
Even if you can find a renter, you then have to manage the property from a distance. If the furnace quits or the toilet gets clogged, the renter will expect you to fix it. Which probably means you have to hire a plumber or whatever. I own a rental property far from my home, and I've had some very annoying maintenance calls. Like the tenant complained that water was coming in when it rained. I sent a carpenter. He told the tenant that she had to close the windows when it's raining. He then charged me $150 for the service call. I had one tenant who totally trashed the place, $10,000 in damage. Etc.
You say it's in a remote area. I assume this means there are few jobs around, so moving there any time before retirement is impractical. You could conceivably use it as a vacation home, but do you want to?
I don't know what the housing market is like in Germany these days. Is there any reason to believe housing prices will rise, or even remain stable? It doesn't sound like it's an investment.
You mention having a place to live if you lost your job or something. But if you couldn't get a job there, this isn't very practical. And, is this some outrageous great deal, or is it likely that you could always buy a house in such an area for a comparable price? If so, it would make more sense to just keep the cash in the bank or some liquid asset, and if you did need a house, then buy one.
All told, it sounds to me like there just is no very good reason to buy this house. Unless it is truly a fabulous deal, like you can buy this house now for 20,000 EUR but next year it is unlikely that anything remotely like it will be available for less than 50,000.
The population of German has been decreasing since 2003 and will continue to decrease through at least 2050. The population will fall from 82.9 million to about 69 million in 2050. (This is according to the Statistisches Bundesamt in Wiesbaden.)
We can see what this means by looking at Japan, which has a similar situation. Housing prices in urban centers have dropped a little, but houses are literally being abandoned because nobody wants them in rural villages.
So from this, owning remote property doesn't sound like a good investment, because demand will probably drop and it will be tough to get your money back, much less make a profit. What happens if all the other local houses get abandoned?