My background is in mathematics: thesis in complex geometry, Ph.D. in something that could charitably be called "discrete optimization". During my Ph.D., I did inferential statistics, essentially analysis of experimental data for psychologists. (Once a few papers were in the pipeline, the lead author married me, FWIW.) It was these papers and my statistical contributions that got me hired in a research job in forecasting. That was in 2006; nowadays such jobs are called "data science" or "machine learning" - these terms did not exist back then. My job title for the last years has involved "data science".
From this vantage point, I would say that CS beats math hands down as preparation for a career in AI/ML. Math is wonderful, but all you need for most of AI/ML is calculus of multiple variables and linear algebra. (Lots of both.) Both of these will happen in your first semesters. Everything beyond that is wonderful, (and in my personal opinion, much more fulfilling than most of what is happening in AI/ML, but your mileage will almost certainly vary from mine) but essentially useless in AI/ML. And you will get most of what you need in these things in a CS bachelor program. Most of what is data science nowadays happens in CS departments, and you will learn most of the tools for AI/ML in CS.
What I most use out of my math preparation is the way of thinking that I got inculcated with there. Mathematicians object when I say that studying math is essentially brainwashing: the way you think is reprogrammed, and consciously so. What you end up with is precisely the way of thinking you need in any analytical field, from management consulting to AI/ML. This is absolutely great, but unfortunately you don't get to learn the actual tools you will be using in that career...
That said, I would very much recommend a third option beyond math and CS: statistics. That CS departments managed to brand themselves as the Machine Learning experts is in my opinion the greatest feat of scientific marketing ever. It is essentially the Machine dog wagging the Learning tail, because the field is all about learning from and dealing with noisy data, i.e., teasing signal out of very noisy data. And that is what statisticians do. Having data science done in CS departments is like having physics done in the tooling workshops, or in the engineering department. Don't get me wrong: engineers are absolutely fundamental to any kind of physics research - but engineering is not physics, and computer science provides the tools used in data science/machine learning, which IMO is a branch of applied statistics. Computer scientists are very good at what they understand. But in my experience, while they are great at designing and developing databases and software to analyze data, they have a very hard time with the specific way of thinking that is required for data science, most of which can be summarized as "being comfortable with noise" (Kolassa, 2016 - ping me if you are interested in that article, and in the meantime, this may be interesting). And of course, the same applies to mathematicians. Both mathematicians and computer scientists can become good data scientists. But both typically underestimate the statistical knowledge and understanding they need. (Conversely, statisticians typically have an easier time understanding that they will need to acquire CS knowledge.)
So, after that little rant, I would recommend you prefer CS over maths if your goal is ML/AI - but that you take a very hard look at the statistical part of any ML program you might be thinking of attending. Ideally, see whether the university actually has a school of statistics, or at least whether anyone in the data science track actually has statistical credentials. Good luck!