The California Zephyr will get you directly from Chicago to Emeryville, CA. Emeryville is just across the bay from San Francisco, and Amtrak will provide a short bus ride over the Bay Bridge into the city. The trip is 3 days and 2 nights.
Train 27 is referring to the Empire Builder. That train goes from Chicago to Portland, OR. From there you'll switch trains, and go south to Emeryville and catch same shuttle bus to San Fran. This trip is 3 days and 3 nights. So one extra night to get there.
Either case, buses meet the train to take you over to San Fran. There are several stops in San Fran, but make sure you make your reservation to go all the way into San Fran., and you can get off wherever you need to. The Ferry Building is where there is an Amtrak ticket office, and the place to stop if you have checked luggage.