Yes. A player that hasn't played international Rugby for 3 years can switch to represent a country that he has a passport for by playing in an Olympic qualifying tournament.
Malakai hasn't played for the All Blacks since July 2017, so if he plays for Tonga in an Olympic qualifying tournament, he can then represent them at any form of the game. Tonga have already claimed Cooper Vuna from Australia this way and Samoa claimed Tim Nanai-Williams from New Zealand.