Network Rail said the contract would ensure that around 3.2 terrawatt hours of energy a year used to power electric trains and signalling would be low carbon.
Around 55% of rail services are electric, with that proportion set to expand rapidly over the coming years as more routes are electrified, including the Edinburgh to Glasgow line.
But the deal was criticised by environmental charity WWF Scotland, which said Network Rail could have chosen to use renewable power sources rather than "dirty nuclear power".
Network Rail chief David Higgins said: "Rail is already the greenest form of public transport and this partnership with EDF will help us make it greener still. Our work to electrify hundreds of miles of railway represents the biggest programme of rail electrification in a generation and will provide faster, quieter and more reliable journeys."