Not even the US, the country that was the most crazed about highways and car infrastructure in the 20th century, demolished its railways - the cargo proposition is just too objectively good. Semi trucks will never have the unparalleled efficiency of strapping many hundreds of tons of cargo behind a locomotive and moving it on rails, both because of their size and because rubber on asphalt is just less efficient.
Passenger rail also makes sense because the same economies of scale can help drive the prices down, and with enough coverage you get enough freedom of movement for 95% of people, with cars and other road transit bridging the last mile. Lots of countries do this very successfully, it's just not a glamorous business.