what two companies built the railroad?