South Australia's train network is on the verge of being back in public hands after three years of privatisation.