The Highland Main Line and West Highland Line are to reopen to trains following inspections along both routes.