Siemens agrees to buy UK railway business, while shedding a non-core business