Re-liquefying under heat treatment I don’t know but if you can forego that requirement, I would recommend E6000. If you do use it make sure to apply and allow to dry/cure in a well-ventilated area. It’s a great adhesive but has its fair share of carcinogens you don’t want to be breathing in..
Do-It-Yourself, Repairs and Fixes
Share tips and tricks to keep people from throwing out that broken item. Repair before replace!
I'm not sure there's a good adhesive that will accomplish this. What's the shape of the earbud? Could a piece of heatshrink on the outside accomplish it?
Hmm… I may be able to similarly get away with a slim strip of electrical tape. Won‘t look good, but I don‘t really care.
A glue used for phones is probably good for you, but it's hard to say if you can soften these with heat: https://www.screenfixed.com.au/top-14-best-mobile-repair-glue/
See if the design will allow for some other way to secure it, like using a small screw as an example. This will take some creativity and caution, but may be a better option if you think you will need to repair them again. (Adhesives have a tendency to not allow for future repairs.)