Barog was settled in the early 20th century during the building of the narrow gauge Kalka-Shimla Railway. It is named after Colonel Barog, an engineer involved in building the railway track in 1903. Currently many residents have their long stays in their houses and flats in Barog. Mostly they are Sikhs from Punjab.

Barog, the engineer, was responsible for designing a tunnel near the railway station. He commenced digging the tunnel from both sides of the mountain, which is quite common as it speeds up construction. However, he made mistakes in his calculation and while constructing the tunnel, it was found that the two ends of the tunnel did not meet. Barog was fined an amount of 1 Rupee by the British government. Unable to withstand the humiliation, Barog committed suicide and was buried near the incomplete tunnel. The area came to be known as Barog after him.

Later it was constructed under Chief Engineer H.S. Harrington's supervision, guided by a local sage, Bhalku, from July 1900 to September 1903.

This tunnel is the longest of the 103 operational tunnels on the route of the Shimla-Kalka Railway, which is 1143.61m long. Barog station is immediately after the tunnel. Barog tunnel is the straightest tunnel in the World.