The Perth to Fremantle railway line opened in 1881 and was Western Australia's first government-built railway, dramatically improving transport between the two cities.