IMO the cheap Russian gas was keeping Germany afloat while it was already crumbling. Germany has been too slow in adapting for the modern age, building out their infrastructure such as fiber[1] or even finishing their part of the NRLA[2] which is still not even close to being finished. They added too much red tape for every little crap[3] making it incredibly difficult for any business to get anywhere (small German you-tubers are dragged to court because they forgot to place a small disclaimer on their website which could have been handled with a small fine or warning).
In recent times trying to compete with other countries a lot has been privatized making the whole thing even worse. You have private infrastructure resulting in the same road being ripped up multiple times every-time another fiber provider wants to add service. You also have the once 80%+ on time rail network being so late that trains are stopped at the Swiss border to prevent time shifts in the tight Swiss schedule. While Switzerland implemented Clock-face scheduling a long time ago Germany moved the date to 2070[4]!
You also now have private low budget trains running on the network. These companies cut corners to the maximum and if one of these trains breaks down it blocks the track. Unlike a bus, you can't just drive around it.
There are also still large parts of the German rail network that aren't electrified. The trip from Zürich to München only recently has been electrified not requiring a locomotive switch.
IMO, infrastructure needs to be public, roads, rail and fiber. Companies need to make money for their shareholders and with infrastructure the profit comes from long term economic growth of a region. This does not translate to direct company profit.
[1] https://netzpolitik.org/2018/danke-helmut-kohl-kabelfernsehe... [DE]
[2] https://en.wikipedia.org/wiki/NRLA
[3] https://www.politico.eu/article/spam-email-gdpr-lawsuits/
[4] https://www.tagesschau.de/wirtschaft/unternehmen/bahn-deutsc... [DE]