A section of a major motorway running through Scotland is to be closed overnight to allow “urgent” resurfacing works.