I just wanted to say that it is highly unlikely that an x-ray was the cause of you phone's demise.
There any many reasons how this could happen, discounting damage on the day, a previously dropped phone (maybe), faulty battery (most likely), component failure (likely), software crash (possible), OTA over-the-air update (less likely) etc.
The amount of radiation you are exposed to during an X-ray is so small that the risk of any damage to cells in you body is extremely low. The machine produces a tiny burst of targeted radiation at a safe level, your bag in the corner probably had infinitesimal, if any exposure.
Millions of phone are x-ray every day at airports with much stronger direct x-rays without any issue.
So, the fact that you were in X-ray is probably just coincidental.
Android phones batteries can suffer when completely discharged, but they can often be persuade to recharge by pressing a sequence of combined power/volume keys pressing.
I hope that puts your mind at rest for your next x-ray.