Advice for a math PhD student who is also interested in a part of EE/CS
I think you are correct in your estimate that doing ML work that requires only basic knowledge of mathematics probably won't get you hired, promoted, or tenured in a mathematics department.  

The best I can say is this: If you publish enough in your pure math area for hiring, promotion, or tenure, then doing additional ML work can be a plus.  Interdisciplinary work and public outreach could be emphasized at your future institution.

The other possibility would be getting a job in industry related to ML, and giving up on your pure math career.  A Ph.D. in math, even in an unrelated field, may be useful for getting hired at such a place.