I'm going through that same decision right now. I'm currently doing an internship at a startup that is allowing me learn machine learning and data analysis in a production setting. Like you I eventually want to do research, but I think grad school is just one way to get there. I'm going to spend another year or so in industry, see if I can make it into doing the kind of research I'm interested in, and if not I'll head back to school.
I see grad school as taking a massive pay-cut over 2-6 years in order to further my education. However, If I can get a similar education while being payed at market value, then there's no competition.