The biggest difference wasn't separating kids into math classes and language classes, but genrally separating them by "good" and "bad". Having a random mix of students, where some can barely read, and others read two books per week (or some can barely multiply, while others code math problems for fun), is a very hard job for the professor, because in the end, they have to lower their standards, expectations, and the quantity of material until most students scrape by. Having a group of students that are good at "school stuff", means the teachers are having very little problems with the basics and can continue faster and prepare students better for university and life. If we had separation for stem-talented students, and language-talented and *-talented, it would be even better.
So basically... group better students together, and you can do a lot more with them, if you don't have to pull the 'bad' students behind. I am aware that this is bad for 'bad' students, and that it should be fixable somehow (they should have options to move to better schools), but good students thrive without idiots in class.