Unfortunately there is no railway system connecting the island of Madeira with the rest of Portugal. Other than catching a flight, the only way to actually reach this destination is via a ferry or boat to the island. There are more than a few commercial ferries travelling to Madeira and back during season.