The federal government is investing more than $45 million in improving railway safety across Canada, transportation minister Anita Anand announced in London on Friday.