A total of 30 authorities which are unable to balance their books have been granted financial flexibilities to protect local services.