SULLIYAN, J.
This is an original application to this court for a writ of mandate to the Honorable W. W. Woods, judge of the first judicial district, commanding him to set *594aside an order made on June 11, 1907, appointing three commissioners to assess and determine the damages which the defendants, who are plaintiffs here, might sustain by reason of the condemnation and appropriation of certain land for a railroad right of way, and to allow plaintiffs in this proceeding to present their defense and evidence in support of the allegations of paragraphs 5 to 11, inclusive, of their answer, in the action brought for the condemnation of said railroad right of way, which paragraphs, with the exception of a portion of paragraph 8, were stricken out by the court on motion, and that the plaintiffs in this proceeding be allowed to have a hearing upon the merits of the controversy as set forth in said stricken paragraphs. The alternative writ of mandate was issued and served upon the said judge. Upon the return day the judge filed his answer and a motion to quash the alternative writ of mandate. The motion is based upon two separate grounds, the first of which is that the affidavit upon which the alternative "writ was issued does not comply with paragraph 5 of rule 28 of the rules of this court, in that it does not disclose the name or names of all the real parties in interest, or the names of those whose interests would be directly affected by these proceedings, and that it does not appear that a certified copy of the affidavit and writ was served upon the real party in interest, and that no proof of any service has been filed in the office of the clerk of this court as required by said rule, and, second, that it appears from the records and files that the acts of which the petitioner complains were the judicial acts of a court of justice acting in his judicial capacity. In limine, this proceeding was commenced in this court under the following title, to wit: “The Idaho & Northwestern Ry. Co., Ltd., a Corporation, Plaintiff, vs. John J. Connolly, Louis I. Sterigere & Idaho Northwestern Ry. Co., Ltd., a Corporation, Defendants” — that being the title of the proceedings brought for the condemnation of said land for the railroad right of way. Upon the hearing, this court directed that all future proceedings in this case be in the name of John J. Connolly, et al., Plaintiffs, vs. W. W. Woods, Judge, et al., Defendants.
*595■ Under the provisions of section 4955 of the Revised Statutes, a party prosecuting a special proceeding must be designated as the plaintiff, and the adverse party the defendant. The case was heard both upon the motion and merits at the same time. A stipulation of facts was filed before the hearing. We will first proceed to dispose of the motion to quash, the grounds of which are above recited. It is contended under said motion that under paragraph 5 of rule 28 of the rules of this court, the affidavit for a writ of mandate must disclose the name or names of the real party in interest, whose interest will be directly affected by the proceeding, and that under the provisions of said rule the applicant must serve upon such party, or parties, in interest, a certified copy of the affidavit and writ issued thereon, in the same manner as upon the defendant, and must produce and file in the office of the clerk of this court evidence of such service. Said paragraph 5 is as follows: “The application for the issuance of any of the above writs must set forth, in addition to the other requisite matters, the reasons which render it indispensable the writ should issue originally from this court, and the sufficiency or insufficiency of the reasons so set forth will be determined by the court in awarding or refusing the application. In case any court, judge or other officer, or any board or other tribunal, in the discharge of duties of a public character, be named in the affidavit as defendant, such affidavit must disclose the name or names of the real party in interest, or whose interest would be directly affected by the proceedings, and in such case it shall be the duty of the applicant obtaining the order to serve or cause to be served upon such party or parties in interest a certified copy of the affidavit and writ issued thereon in the same manner as upon the defendant named in the affidavit, and to produce and file in the office of the clerk of this court the same evidence of service.” While the application for the writ shows the name of the real party in interest, to wit: The Idaho & Northwestern Ry. Co., there is no proof of any service of the affidavit and writ upon such party, and it was conceded on the argument that no such service had been made; *596therefore the motion to dismiss ought to be sustained. It is true, the orders complained of were made by the court or judge, but the real party in interest is said railway company, and in all such cases it is usually considered that the party in whose favor an order is made will see to it, and defend on behalf of the judge or court, and the provision of said rule requiring the service of a certified copy of the affidavit and writ issued to be served upon the real party in interest and to file the evidence of such service with the clerk of this court is only a reasonable provision, and must be adhered to in this class of proceedings.
In support of the second ground of said motion, it is contended that the orders of the court complained of were the judicial acts of said judge acting in a judicial capacity, and hence could not be controlled by a writ of mandate. The act complained of is the striking out of certain paragraphs of the answer, thereby depriving the defendants of their alleg'ed defense. That defense in substance is that said railway corporation has been created and organized fraudulently for the sole purpose of enabling the B. R. Lewis Lumber Company, a private corporation, to evade the laws of the state, in order that it may indirectly be enabled to exercise the right or power of eminent domain for its own private use and benefit, and not for the use and benefit of the general public as a common carrier of passengers and freight. While there were specific allegations or averments in the answer of other matters affecting the organization and incorporation of said railway company, the most of them go to the question of the fraudulent organization of said company, and that it was not organized for the benefit of the public or for public use, but was organized for a private purpose, and therefore was not entitled to exercise the right of eminent domain in the condemnation of land for a right of way. One of the prominent questions in this case is whether the Idaho and Northwestern Railway Company is building or extending its lines of railway for public or only for private purposes. In other words, whether, under the provisions of our constitution and law, that railway company is, in fact, a public service corporation, *597and for that reason required, and may he compelled, to serve the public in carrying freight and passengers. If it is a public service corporation, then it has the right of eminent domain, and the defense that it has been fraudulently organized for private^purposes is not a defense in that action. If it has refused to carry saw logs of others or transport their freight, it may be compelled to do so. Section 5 of article 11 of the state constitution is as follows: “All railroads shall be public highways, and all- railroad, transportation and express companies shall be common carriers, and subject to legislative control, and the legislature shall have power to regulate and control by law the rate of charges for the transportation of passengers and freight by such companies or other common carriers, from one point to another in the state. Any association or corporation organized for the purpose shall have the right to construct and operate a railroad between any designated points within this state, and to connect within or at the state line with other railroads of other states and territories. Every railroad company shall have the right, with its road, to intersect, connect with, or cross any other railroad, under such regulations as may be .prescribed by law, and upon making due compensation. ’ ’ That section provides that all railroads shall be public highways, and shall be common carriers subject to legislative control. Under that provision of the constitution, every railroad is made a public service corporation, and is therefore entitled to the right of eminent domain, and if it refuses to perform any of the duties that it owes to the public, it may be compelled to do so. The defense stricken out by the court was no defense in that action. The second question raised by said . motion is whether mandamus can be used under the laws of this state to correct an order of the court in passing upon a motion to strike out portions of a pleading. The court has jurisdiction to pass upon motions to strike certain paragraphs from a pleading. The general rule is that it is not the function of mandamus to reverse orders of inferior courts or tribunals acting within their jurisdiction. (High on Extraordinary Legal Remedies, 2d ed., sec. 183.) It is said in State v. Edwards, Justice, 51 *598N. J. L. 479, 17 Atl. 973, that the function of mandamus is to insure action where inaction prevails, to speed a cause which has fallen into judicial stagnation. Under the provisions of section 4977 of the Revised Statutes, a writ of mandate may be issued by any court, except a justice’s or probate court, to any inferior court, tribunal, board or person, to compel the performance of an act which the law specially enjoins as a duty resulting from an office or trust, and section 4978 provides that the writ must be issued in all cases where there is not a plain, speedy and adequate remedy in the ordinary course of law.
The first judicial district court had jurisdiction to pass upon the motion to strike out portions of said pleading and has exercised that jurisdiction. It therefore did not exceed its jurisdiction in performing said duty. If it erred in the decision of said motion, such error cannot be corrected by mandamus. Had it refused to pass upon or decide said motion, it could have been compelled by mandate to decide it, but it could not have been compelled to decide it in any particular way, and the authorities hold that it is not the function of mandamus to reverse the orders of inferior courts or tribunals of which they had jurisdiction, but if they had jurisdiction and refused to act, then they may be compelled to act by mandate.
The case of Hill v. Morgan, Judge, 9 Idaho, 718, 76 Pac. 323, is not in point. In that case the trial court held that it had no jurisdiction to proceed and try said cause, and for that reason declined to proceed with the trial. This court held that it acquired jurisdiction and directed the trial to proceed. In that case, in limine, the judge held that he had no jurisdiction, while in the case at bar, the court had jurisdiction, and proceeded within it.
Recurring again to the right of eminent domain, it will be observed that very few states have constitutional provisions as broad as our own on that subject. The contour and formation of the state and its industries of mining and irrigation made it absolutely necessary for the complete development of the resources of the state to have very liberal laws on *599the subject of eminent domain. The framers of our constitution, fully realized that, inserted in the constitution of this state section 14 of article 1, which is as follows: “The necessary use of lands for the construction of reservoirs, or storage basins, for the purposes of irrigation, or for the right of way for the construction of canals, ditches, flumes or pipes, to convey water to the place of use for any useful, beneficial or necessary purpose, or for drainage; or for the drainage of mines, or the working thereof by means of roads, railroads, tramways, cuts, tunnels, shafts, hoisting works, dumps, or other necessary means to their complete development, or any other use necessary to the complete development of the material resources of the state, or the preservation of the health of its inhabitants, is hereby declared to be a public use, and subject to the regulation and control of the state. Private property may be taken for public use, but not until a just compensation, to be ascertained in a manner prescribed by law, shall be paid therefor.” This court had that section under consideration in the ease of Potlatch Lumber Co. v. Peterson, 12 Idaho, 769, 88 Pac. 426. We do not cite this case as having any particular bearing on the case at bar, except to show that under our constitution the authority to exercise the right of eminent domain has been extended and made broader, than that right in many of the states, and is not made to depend upon the narrow and restricted meaning of the phrase “public use” as defined by the courts of last resort of some of the other states. We therefore arrive at the conclusion that said railway company was organized as a railroad corporation under the laws of this state, and under the provisions of the constitution and law it is a common carrier, and cannot legally use its line of railroad for the private use and benefit of anyone, even if it so desired, and so intended at the time of its organization, and for that reason the defense stricken out of the answer was not a good defense.
We also conclude that the action of the court in striking said defens.e from the answer was a judicial act within the sound legal discretion of the court, and in that matter the court acted within its jurisdiction, and in its judicial capacity.
*600For the reasons above stated, the motion must be sustained, the alternative writ quashed, and the proceedings dismissed. Costs awarded to defendants.
Ailshie, C. J., and Stewart, J., concur.