what two groups arrived in large numbers in the united states for the primary purpose of working on the transcontinental railroad?