State governments risk credit rating downgrades if spending rises, S&P warns, amid political pressure to provide cost-of-living relief.