The first was built by the nominally independent Leadburn, Linton and Dolphinton Railway. It opened in 1864 and was soon absorbed by the North British Railway, becoming that company's Dolphinton Branch. The second was built by the Caledonian Railway, and it opened in 1867. The population of Dolphinton then was 260, and the primary purpose of the lines was to secure territory, rather than to serve the small local community.
Each line had its own terminal station. The North British Railway line closed in 1933 and the Caledonian line closed to passengers in 1945 and to goods in 1950. There is now no railway activity on the lines.
The Caledonian Railway opened its main lines between Glasgow, Edinburgh and Carlisle in 1848 - 1849. From the outset the company strove to capture as much territory as possible by leasing locally promoted lines, intending to achieve early dominance in areas against the rival North British Railway (NBR), the Edinburgh and Glasgow Railway, and the Glasgow and South Western Railway. This aggressive stance against large competitors characterised the Caledonian for many decades.
In 1855 the independent Peebles Railway opened its line, connecting Edinburgh with Peebles. It relied on the North British Railway for access to Edinburgh, but for the time being it operated its line itself.
A coach connection ran from Dolphinton by way of West Linton to Leadburn, joining the Peebles Railway there, but the citizens of Dolphinton saw the economic benefits of being on a railway line, and they wanted their own railway.
The rural nature of the terrain made it unlikely that a local scheme could be financially successful, but there was intense rivalry between the North British Railway and the Caledonian Railway. The massive ironworks industry of the Monklands, centred on Coatbridge, was located in Caledonian territory, and the furnaces had a great appetite for coal. The Caledonian was known to be interested in getting its own railway access to the Lothian coalfields, an area that the North British considered belonged to themselves. At the same time the North British harboured hopes of penetrating as far as Coatbridge with a new line of its own.
In fact in 1858 the Caledonian published a planned railway from Carstairs, on its main line, to Leadburn through Dolphinton; Leadburn would give it access to the Peebles Railway, which in turn would incorporate the productive coalfields south of Edinburgh. In making its intention plain, the Caledonian called this proposal the Caledonian and Peebles Junction Railway.
The North British Railway was alarmed by the proposal, and prepared a blocking railway, the Leadburn, Linton and Dolphinton Railway (LL&DR), and opposed the Caledonian Bill. At this period the NBR practice was to encourage and support local, nominally independent railway companies, intending to take them over in later years when their profitability had become established.
In February 1862 the Caledonian Railway met with the LL&DR proprietors and invited them to sever all connection with the NBR; if they did the Caledonian would build a new cross-country line from Carstairs, through Dolphinton, to Leadburn: the Caledonian and Peebles Junction line would save the Dolphinton group the trouble of building their own line. The LL&DR refused, and the Caledonian turned hostile; they warned the LL&DR that they had become entangled with a hostile party who had for years been obstructing the Caledonian traffic.
The two proposed lines were considered together in the 1862 Parliamentary session, and both were authorised by Act of Parliament on 3 June 1862; the capital was £53,300. However Parliament declined to encourage the territorial incursion of the Caledonian scheme, and it was authorised as far as Dolphinton only. The small community, with a population of 260, was to have two railways, both intended for tactical purposes and hardly connected with traffic at Dolphinton itself.
The LL&DR was to be designed by Thomas Bouch on his "cheap railway" principle, and he explained to potential shareholders that the ten mile line would cost no more than one mile of conventionally engineered route.
The LL&DR opened on 4 July 1864. The North British Railway must have been showing its hand with regard to extension westward, for the Scotsman newspaper reported that the LL&DR was "shortly to form a central part of an important trunk line".
The Caledonian line opened much later than the LL&DR, on 1 March 1867. The Caledonian and NBR stations were not immediately adjacent, being respectively west and east of the road that is now the A702. Each station had the usual facilities, including a locomotive turntable each. There was an exchange siding between the two stations for wagon exchange, but no through movements took place.
The LL&DR line
Stations on the ten mile long LL&DR line were Lamancha, Coalyburn (later renamed Macbie Hill in 1874) and West Linton (later renamed Broomlee).
During the construction of the line, there was a collision at the junction with the Peebles Railway at Leadburn on 29 October 1863. A construction train working on the Dolphinton line ran away on a steep gradient to Leadburn. The only protection to the main line was a scotch block at Leadburn, and the runaway vehicles ran over the block and collided head on with an approaching passenger train on the Peebles line; a boy was killed and several persons were injured.
In 1895 there were four passenger trains each way Monday to Friday, with five on Saturdays.
The Caledonian line
The line was just under 11 miles (17 km) long and there were significant engineering works required on the route.
There were four daily (except Sundays) return passenger trips on the line in 1895. There was no attempt to co-ordinate the trains at Dolphinton, and through booking of tickets was not possible.
The Leadburn line closed in 1933, leaving the Carstairs line the sole connection. The Caledonian line was suspended from 12 September 1932 until 17 July 1933, and the passenger service was finally discontinued after 2 June 1945. Goods services continued until November 1950. 
The Caledonian line opened on 1 March 1867; it was suspended from 12 September 1932 until 17 July 1933, and finally closed to all traffic on 4 June 1945. Locations on the line were:
- Carstairs; station on the main line;
- Dolphinton Junction; apex of the triangle from Strawfrank Junction, and divergence from the Edinburgh main line;
- Bankhead; the station first appeared in timetables from November 1867;
The LL&DR line opened on 4 July 1864, and closed to passengers on 1 April 1933, and completely in November 1950. Locations on the line were:
- West Linton; renamed Broomlee in 1864;
- Coalyburn; renamed Macbie Hill in 1874 (occasionally spelt Macbiehill);
- Leadburn; converging junction with the Peebles to Edinburgh line.
- Peter Marshall, Peebles Railways, Oakwood Press, Usk, 2005, ISBN 0 85361 638 8
- John Thomas, The North British Railway, volume 1, David & Charles, Newton Abbot, 1969, ISBN 0 7153 4697 0
- John Thomas, Forgotten Railways: Scotland, David and Charles, Newton Abbot, 1981, ISBN 978-0715381939
- E F Carter, An Historical Geography of the Railways of the British Isles, Cassell, London, 1959
- David Ross, The North British Railway: A History, Stenlake Publishing Limited, Catrine, 2014, ISBN 978 1 84033 647 4
- Roy Perkins, The Railways of Peebles, Amberley Publishing , Stroud, 2013, ISBN 978 14456 13871
- Scotsman newspaper, 4 July 1864, quoted in Ross (North British Railway).
- Gordon Stansfield, Lanarkshire's Lost Railways, Stenlake Publishing, Ochiltree, 1997, ISBN 1 872074 96 0
- David Ross, The Caledonian: Scotland's Imperial Railway: A History, Stenlake Publishing Limited, Catrine, 2014, ISBN 978 1840 335842
- John Thomas revised J S Paterson, A Regional History of the Railways of Great Britain: Volume 6, Scotland, the Lowlands and the Borders, David and Charles, Newton Abbot, 1984, ISBN 0 946537 12 7
- Bradshaw's General Steam Navigation and Railway Guide, 12th mo, (December) 1895, reprinted by Middleton Press, Midhurst, 2011, ISBN 978 1 908174 11 6
- M E Quick, Railway Passenger Stations in England Scotland and Wales—A Chronology, The Railway and Canal Historical Society, 2002
- Col M H Cobb, The Railways of Great Britain -- A Historical Atlas, Ian Allan Publishing Limited, Shepperton, 2003, ISBN 07110 3003 0
- Paterson actually gives the date as 31 July 1865, but this is a mistake.