It continued to administer the islands as a mandate and then as a trust territory until 1962 , when the islands became the first Polynesian nation to reestablish independence in the 20th century .