Some 20 years ago politicians decided that the functional but not profitable state railways were to be privatized. But it was too big to just sell it in one piece, so they opened the market to anyone. Infrastructure however was kept in the state-buisness and told to downscale hard and become a profit center.
So some geniuses decided that some infrastructure was being used too little and closed it. Turns out that if you remove either A or B trains going from A to B won't go anymore. This sent the railway network into a death spiral and it has yet to hit rock bottom.
Every last bit of reduncany, that would've been well needed with some branch line still running on pre-WWI signage, has been removed. There's nowhere a passenger train could overtake a late freight train or vice versa.
Every time a state orders a new line for public transport (only long distance runs without subsidies), the very cheapest one gets the deal. No money goes into railway maintenance. Even worse, extensive rebuilds are paid by the government, but maintenance has to be done by the remnants of the state railways, to then rent track time to the private companies taking the cake. So that's not happening...
Incompetence and bureaucracy reign hand in hand, everything's at the limit and investment is only ever announced but never delivered.
Our railways are a fucking laughing stock and will be for decades to come.