The Union Pacific Railroad was one of the two companies that were tasked with building a transcontinental railroad. The other one being the Central Pacific Railroad Company. These two companies were assigned the project after Abraham Lincoln signed the Pacific Railroad Act into law.
The act gave each company 6,400 acres of land (later doubled to 12,800) and $48,000 in government bonds for every mile of track built. This is how the Union Pacific Railroad acquired supplies to build the transcontinental railroad. Moreover, the act established also established that the Central Pacific Railroad Company would start building in Sacramento and continue across the Sierra Nevada, while the Union Pacific Railroad would build westward from the Missouri River, near the Iowa-Nebraska border.