Shame we have the "debt brake" preventing any serious investments: https://en.wikipedia.org/wiki/Debt_brake_(Germany)
The debt brake can be "disable" though, this is the case right now for COVID and Peter Bofinger has made an interesting argument that one might also be able to do this for investments to defeat climate change by declaring this is a natural disaster. Although anyone who tries that probably has to make that argument to the constitutional court.
The debt brake isn't based on economic considerations though, it's rather based on ideology, much like austerity (which is known to be counter-productive when used to "save the economy"). The correct solution would be to remove the debt brake and address the problems it is meant to prevent directly, but nobody involved wants that.