What are the academic career prospects for someone in their late 30's starting a PhD?
I think the answer here is that it depends on a lot of factors, but that you'll generally do better in the Machine Learning field than you would in many of the older, more established fields.

For starters, there's just not that many people out there with PhDs in Machine Learning.  I'm an economist, but I've spent a lot of time working around the edges of machine learning and data science.  Many of the faculty in that area have degrees in different but related fields.  Econ, stats, math, and computer science are common.

Machine learning is also an incredibly hot field right now.  Before I went back to academia I worked in applied research, and finding an experienced person with a "data scientist" title in their job history was a nightmare.  Private sector jobs are common, and the salaries are high, which pulls people away from academia.  

So while being an older graduate hitting the job market may be a challenge in academia, I think the shortage of talent available in this field will offset it.  Especially if you have relevant work experience in data science, research, and/or machine learning from before now.

On a side note, unless your goal is specifically to do PhD research (i.e. are you interested in applying ML in teaching or research, or are you interested in working on the mathematical underpinnings?) in the field and earn tenure, you can accomplish a lot, even in academia, with a master's degree in this field.  Might be something to explore if you decide not to go the whole way.