All state board has different rule on this. But in CBSE board there is a rule if a student fails in class 8 he can appear for a supplementary test and if the student qualifies the test he will be promoted to class 9.
But here my colleague’s brother has shared his experience on this point that he had failed in his class 8th but after requesting to his teacher by his parents he had been promoted in class 9th.
So it can also depend on your school or state board.