Swedish Railroad History
The railroads got started relatively late in Sweden and the first real line was opened first 1856. One reason was that Sweden was still a relatively poor country back then, but more importantly was that the first attempt to bring a railroad was not successful. In the middle of the 1840s a Swedish nobility was granted a right to build railroads in Sweden, and I think that he was even granted a monopoly. It was to be financed by some British people or companies, but there was a problem with getting the money, so the railway was never built in any way that resembled what was the original plan (it did eventually became a railway between a harbour in a Swedish lake and a town not that far from the lake).
Disillusioned by the failure the Swedish government decided that it would have to build and own the main routes. It built one route from Stockholm (the capital on the eastern coast, at the Baltic Sea) to Gothenburg (the second largest city on the western coast, basically at the Atlantic), a second line from Stockholm to Malmö (third largest city, in the south, very near Copenhagen, nowadays just a bridge away), and a third main line from Stockholm and north. This decision also meant that local private railways were supposed to be built and often connected the main lines. Well, private and private, they were often partly financed or owned by local governments and I think that there was also usually some kind of national government funding available.
There were some problems with this model. First, the government was mostly interested in making sure that it was possible to haul passengers and goods in long way, and the main lines usually avoided a lot of the bigger cities when building the routes, especially if it meant dealing with harder terrain. There was also a strict principle of not building the main lines along the coast (so that invaders could sabotage the railroad). This was especially problematic in the north where all bigger cities were located along the coast, so that all those cities had secondary lines to connect them to the main line, and basically it looked like this, with the coastal cities on the right.
There was a new railroad built in the beginning of the 20th century that went along the coast for about the southern most half from Stockholm (well actually Uppsala I guess) and upwards.
In the southern part of Sweden, the private railways were short and mostly connected two or three cities and the villages in between. In the middle the private railways were longer, and in the north (where almost everyone lived in coastal cities that weren't really populated until the 18th and 19th century) the state actually built and ran most of the railways. In the early 20th century a lot of the private railroads were in financial trouble, part because the government prohibited the private railroads from becoming large enough to compete with the government owned main lines, thereby making them operate under less than perfect economic conditions in order to meet the problem of roads and goods and people that traveled on roads. The conclusion was that in 1939 the government decided to buy out most of the private railways. I think that the last private railroad was bought out in the 1960s.
One effect was that the Swedish railroad net was at its largest in 1938, and the government closed down a lot of less profitable routes after taking over the private railways, especially in the 50s and 60s. Basically, no new railroad was built between 1930 and 1990, though some of them were upgraded to be electric or double track or heavier rails or higher speed.
In 1988 Sweden became the second country in Europe to try some kind of re-privatization trick. The old government monopoly was divided into several governmental-owned "private" companies that were expected to make a profit. One government agency that owned the rails, one government-owned company that hauled profitable passenger-lines, and one that hauled goods (well actually two, since one of the last private companies that was bought up had somehow remained relatively independent of the main governmental railroad company, even though it was owned by the government, so basically there was two government-owned companies that wanted to haul goods on the Swedish lines and there has been some new private companies that also has been interested in hauling goods).
There were/are also government-owned companies that supplied meals for passenger trains and that repaired trains and similar. I think that it was at the same time that regional passenger transports were transformed to the regional governments (basically Sweden is divided into local, regional, and national government, even though almost everything is decided at the national level). This meant that the regional governments got control of the regional and local passenger transportation, and they all made special companies that were going to handle all regional mass transportations and control city bus lines, regional bus lines, and regional train lines and that set the fares. These regional companies normally let companies bid for how much they needs to run a specific bus line or train line, or a bunch of lines, which has led to a boom in regional traffic. In fact a lot of the railroad traffic is ran by the national passenger company, but for the various regional governments, but since they know that the regional governments won't hesitate to make private companies run it instead if the bid is too high, which leads to that there is a general tendency to make low bids and at least in the beginning make regional transports a lot cheaper.
Today the government owned company has a monopoly on lines that they define as profitable, and the rest of the long lines are purchased by the lowest bidder (basically true for the line to north of Sweden) as is all of the regional lines. It has also been talked about letting private companies run the lines that the state-owned company currently considers profitable, but it hasn't happened yet. Also, since 1990 several new lines have been built, and it kind of seems like a new dawn for rail transports.