Can you expand a bit on your question? In which city are you using Maps for this?
I tried to replicate your search between two of my local railway stations with and I was given the route by foot to the nearest station, and then by rail between the two stations.
I then went into Settings > Maps > Directions, and removed the tick from all the options for Public Transport in the Directions panel except for Bus. This is different to the the Preferred Type of Travel panel above, in which I had selected only Public Transport. Back in Maps I did the same search again and I was given the route between the two railway stations by bus.
Perhaps you are getting only the bus routes in your search for the same reason?
Another option, of course, is to use the rail/public transport maps or the app issued for mobile devices from the local transport authority.