Whenever the commission shall be of opinion that any public service company is failing or omitting, or about to fail or omit, to do anything required of it by law, or by order, direction or requirement of the commission, or is doing anything, or about to do anything, or permitting anything, or about to permit anything to be done contrary to or in violation of law or of any order, direction or requirement of the commission authorized by this title, it shall direct the attorney general to commence an action or proceeding in the superior court of the state of Washington for Thurston county, or in the superior court of any county in which such company may do business, in the name of the state of Washington on the relation of the commission, for the purpose of having such violations or threatened violations stopped and prevented, either by mandamus or injunction. The attorney general shall thereupon begin such action or proceeding by petition to such superior court, alleging the violation complained of, and praying for appropriate relief by way of mandamus or injunction. It shall thereupon be the duty of the court to specify a time, not exceeding twenty days after the service of the copy of the petition, within which the public service company complained of must answer the petition. In case of default in answer or after answer, the court shall immediately inquire into the facts and circumstances in such manner as the court shall direct, without other or formal pleadings, and without respect to any technical requirement. Such persons or corporations as the court may deem necessary or proper to be joined as parties, in order to make its judgment, order or writ effective, may be joined as parties. The final judgment in any such action or proceeding shall either dismiss the action or proceeding or direct that the writ of mandamus or injunction, or both, issue as prayed for in the petition, or in such other modified form as the court may determine will afford appropriate relief. Appellate review of the final judgment may be sought in the same manner and with the same effect as review of judgments of the superior court in actions to review orders of the commission. All provisions of this chapter relating to the time of review, the manner of perfecting the same, the filing of briefs, hearings and supersedeas, shall apply to appeals to the supreme court or the court of appeals under the provisions of this section.