My first thought about this post was" At that age??????" He is not just immature, something is wrong here. If he were just immature he would have not made it this far. I think maybe a learning disability or some issue is maybe just starting to show and the school may not be dealing with it correctly.
How humiliating for him to be held back now, when his classmates will be totally aware of the flunking, how sad for him.
Tell them to get him a tutor or take him to a psychologist for an educational evaluation. I had one done in college because I hated math and had flunked beginning algebra 3 times, at 3 different colleges. BTW,my ACT scores were all very high, except math which was a 7...need I say more?
I had a learning glitch in math, not an actual disability but a real glitch so I got un-timed tests, open book tests, etc...but it still didn't help. I finally got an educational therapist who sat with me for 3 hours a week and we worked on algebra. She discovered if we put everything into colored groups I finally understood what to do. Addition numbers and symbols were green, negative numbers and signs in red, etc...each step was seperated by differnt colored lines and it finally started making sense.
For instance 3 - 5 = -2:
the 3 would be green, the minus and 5 would be red, the equal sign black and the answer some fun color like purple.
I finally made a B in beginning algebra. So I know with the right person working with you and the right situation that things can be turned around. He can't just be immature at this age, I think it is something else going on.