Wherever any railroad is or shall be crossed at grade by a public road, street, or highway, and the railroad company shall have constructed or shall construct, or there shall have been or shall be constructed by others, with such company's consent, an undergrade subway or an overgrade bridge or crossing, sufficiently near said public crossing to reasonably accommodate the traveling public, the court of quarter sessions of the county in which the said crossing exists, upon petition of said railroad company or other persons, may, if satisfied that said undergrade subway or overgrade bridge or crossing reasonably accommodates the traveling public, after notice to any corporation using or occupying or authorized to use or occupy the street, proposed to be vacated, with tracks, wires, pipes or conduits, and, by rule to show cause, to the supervisors if the said crossing is in a township, or to the burgess or mayor if said crossing is in a borough or city, and after testimony, taken either in open court or by deposition, as the court may direct, order that said road, street, or highway where it crosses said railroad at grade, and its approaches on both sides, shall be vacated, and that the said undergrade crossing or subway or the overgrade bridge or crossing and its approaches on both sides, substituted therefor, shall be a public highway, and be maintained by the proper authorities; and any company which had rights in or upon the street so vacated shall have, and be permitted to exercise, the same rights upon said streets, highways, bridges, and subways so opened, and to connect the same with its system without obtaining further authority or consent.
36 P.S. § 2111