How did railroads influence the growth of western territories?