In all matters, proceedings and hearings before the courts of quarter sessions relating to the laying out, opening, reviewing or re-reviewing of public or private roads and claims for damages, or any other matters relating to such roads, in the different counties of the commonwealth, it shall be lawful for the court hearing such proceedings to make such order about the payment of the necessary costs incurred as to the court shall appear right and just.
36 P.S. § 2441