Hi,
Yes, you can re-size your VM to a larger size that includes 16GB RAM and then when you want re-size it back down to previous size. To do this, navigate to your VM in the Azure portal, click on Availability + scale -- Size blade. Select the new VM size on the right and click Resize.
NOTE: Your VM needs to be restarted for the new size to take effect.
Please click Accept Answer and upvote if the above was helpful.
Thanks.
-TP