Section 4. A railroad corporation chartered by the concurrent legislation of this and other states shall, as regards any portion of its railroad lying within this commonwealth, be entitled to all the benefits and be subject to all the liabilities of the railroad corporations of this commonwealth.