As struggling municipalities face shrinking income and mounting debt, innovative renewable energy models are aiming to stabilise costs and secure power systems