Close to the Spanish railway museum is the metro stop Arganzuela - Planetario, which is on the #6 line, the circular one. As the name suggests, there is also a planetarium close by. The main wall in the station has a bit of a worldly motif as well, which is quite interesting, especially coming down the escalator.
When in Madrid, the best way to get around the city is by using their very extensive Metro system. One ride is just a few pennies over a Euro, so its also very affordable. Buying a ticket for 10 trips is the best bet; or if you plan to ride it a lot, you can by a 3 or 4 day pass.
The Metro station pictures in the Arganzuela-Planetario and is on the Circle Line.