Network Rail will close lines in the west and north of Scotland from the night of 24 October, with speed restrictions across large parts of the country.