The village looks like it was served by a rail line once. The shuttle bus comes the valley and actually enters the carpark at the lodge. When I was there it was $7 to the visitor center.
Check with the staff @Yosemite Valley Lodge.
I don't know about any train station transportation, but there is a bus stop at the hotel.
Thanks! Your answer is awaiting moderation.