edit: I understand that some can work on a PhD without any financial motivation but purely as a passion. I enjoy doing research just for the sake of it but I do not have the freedom to not think about finances.
To answer your question: If you can potentially land a job at a FAANG or Microsoft Research or in SV or NY, then it probably will pay-off in the long run. Academic research jobs are very hard to get. By the time you graduate with a PhD, ML might no longer be the trendy field. AI has been on and off trend for over 50 years.
In summary, whilst there is a chance of eventual financial advantage, the real value of a PhD is in being paid to pursue an interest that you are passionate about.
Good luck!