There are a variety of hot glue adhesives, and there's no blanket statement that could be made to cover all of them.
However, I has seen industry use (ie, on the assembly line) of hot glue around the capacitors of the high voltage section in a CRT for vibration purposes. The glue came into contact with many of the leads and PCB tracks in that area of the PCB, so I know that there are hot glues which are suitable for electrical use, and appropriate even for high voltage insulation, though insulation was not the primary goal in this case.
You can test your hot glue with a mega-ohmmeter if you have concerns about the particular formulation you are using.
Is there a better way to mount these relays?
There are relay mounts and sockets for many styles of relays. You can also get relay connectors and relays with mounting tabs. These are preferable to adhesives for many applications.
When I've needed to mount relays in a chassis I've used zip ties and hot glue for short term and light duty usage, and metal brackets for heavy duty or long term usage.
I don't typically use hot glue on the bare wires and terminals themselves, and if I do I use heat shrink tubing to insulate the wires and terminals first.