Why did the transcontinental railroad start?

The government needed a faster way to transport troops and mail. Settlers wanted to travel faster. Farmers need to transport their goods faster and more cost efficient.