Are you sure the glass is actually loose? I have never seen the glass come loose at the top of the screen, unless someone removed the glass previously. The only other reason I can see for the glass to separate is if some liquid got inside the glass and damaged the adhesive. If the adhesive is damaged, then heat probably won't help.
With these older laptops, it is much more likely the anti-reflective screen coating is rubbing off. It is very hard to tell from your pictures, but this is what it looks like to me. If the issue is only found around the edges of the glass, then just ignore it since it does not affect the normal viewing area. Even if the coating is rubbing off in the main viewing area, many times it won't affect the use of the laptop. It is possible to remove the anti-reflective coating, but it is not easy to do and may result in an inverted condition where some parts of the screen will have the coating that cannot be removed. Also, removing the coating can result in catastrophic damage to the display where it will be unusable.
Apple had a secret free repair program for the issue which is covered for up to four years after purchase, so it is most likely expired for your 2015 laptop. Here is an article which has some pictures of the condition which you can see looks like what is shown in your pictures. On many Macs, I find the issue only occurs around the camera (from people rubbing the glass when opening/closing the lid) or along the edges (from cleaning the laptop with chemical cleaners).
https://www.macworld.com/article/671767/retina-macbook-pro-what-is-staingate-what-can-you-do-about-it.html