Heavy rain brought flooding overnight, shutting some rail lines and prompting advice to passengers not to travel on some parts of the network.