The agreement commits Network Rail to commissioning the new 30 mile railway and seven new stations by summer 2015 between Edinburgh and Tweedbank.
The capital construction cost of the line will be £294m and the total 30 year construction and maintenance cost of the scheme is now £60m less than initial estimates.
Transport Minister Keith Brown said: “Borders Railway will bring inward investment for the local community plus approximately £33 million of benefits for the wider Scottish economy.
“It will support 400 jobs during the construction phase and act as a catalyst for increased business development and housing opportunities within easy commuting distance of Edinburgh.
“It remains a very clear target for the Scottish Government to have the railway line in place by the end of 2014 and we will be working closely with Network Rail and BAM to achieve this .
“I have asked for a further review of the programme in nine months from now once construction is well underway and we have had an opportunity to make a further assessment of the risks.”
David Simpson, Route Managing Director, Network Rail Scotland said: “We’re delighted now to have reached an agreement on delivery of a project which will finally bring Midlothian and the central Scottish Borders back into the railway network.
“This agreement sets out an achievable delivery schedule and allows us to have trains running along the route in summer 2015.”
The Borders Railway will re-establish passenger railway services for the first time in over 40 years from Edinburgh through Midlothian to Tweedbank in the Scottish Borders.
The new line will include 30 miles of new passenger railway with three existing stations and seven new ones.
From north to south, new stations will be built in Shawfair, Eskbank, Newtongrange, Gorebridge, Stow, Galashiels and Tweedbank.