How can I update text_format value in Ajax callback?
Don't change $form in an ajax callback. See this documentation for D7:

https://www.drupal.org/docs/7/api/javascript-api/ajax-forms-in-drupal-7


  Details and Warnings
  
  Changes to the form must only be made in the form builder function, or
  validation will fail. The callback function must not alter the form or
  any other state.


For D8 there is in the moment only documentation for the new syntax, but not for the basics. Use the D7 doc's instead.