Hello,
You are correct. As long as the machine stays up the ephemeral external IP will be assigned to it. Ephemeral external IP addresses are released from a resource if you delete the resource. For VM instances, the ephemeral external IP address is also released if you stop the instance. After you restart the instance, it is assigned a new ephemeral external IP address[1].
[1]https://cloud.google.com/compute/docs/ip-addresses#ephemeraladdress
If you wish to make sure that your VM’s ephemeral IP address is the same after a maintenance event I would suggest that you set the VM to live migration (this is the default setting). See these links[1][2][3][4] for more information.
[1] Maintenance events :
https://cloud.google.com/compute/docs/instances/host-maintenance-overview#maintenanceevents
[2] Live migration during maintenance events :
https://cloud.google.com/compute/docs/instances/live-migration?hl=en
[3] Set VM availability policies : Set availability policies :
[4] Stopping, suspending, or resetting a VM :