He was born in Christiania as a son of Colonel Axel Wulfsberg Heiberg (1832–1904) and his wife Emma Sejersted (1840–1930).
After graduating in machine engineering in 1890, he was hired as a draftsman in the Norwegian State Railways.
In 1899 he left the State Railways to become managing director of the manufacturing company Skabo Jernbanevognfabrik.
[1] In 1924 Heiberg left Skabo to become director-general of the Norwegian State Railways, a position he held until 1938.
The State Railways were haunted by economic problems during his time as director, owing to the general economic hardships of the interwar period, and for the first time in its history the State Railways had to discontinue parts of its service.