What do you mean given up? They’re still laying more rails and running more trains than ever. Even running dozens of trains a day, like 95% of the time the trains are fully booked, or it’s just soft sleepers and maybe standing available if you try to book the day of, or even a few days in advance for longer routes.
Japan still runs trains to areas where there’s 1 village every 15-20 miles. Single track, that splits at the odd unmanned platform so people can board and trains can pass each other, and they have a train like every 10-15 minutes.
The USSR didn’t even bother with the platforms sometimes, just had a guy driving a locomotive by a bunch of villages every few hours, stopping any time he saw a farmer who had to take some cows to market or whatever.
Roads are expensive to build and maintain, cars are expensive to build and maintain. Every trip taken on a train or bike instead of a car saves the tax payers money.