She knew very well that Akheraj will beat her up. So it is not that she didn't know. She is scared of his beating too.
Don't know why it is being ignored that she just witnessed a very gruesome murder with her own eye and not to get disturbed by it. Even adults will be disturbed after seeing such an act and why expect sensible behaviour from a kid who was scared and horrified at the sight of this?
She was terrified that Akheraj would kill her too and she was hiding in the cupboard but the way Akheraj is trying pass of Gopal's death as suicide did make her stand up for Gopal
Then she started wondering why all these people who punish her for her small lies and chaeating are lying adn nobody is saying anything - That obviously is innocence of a child.
This was the child who was beaten up for cheating over fast and don't know for what all small things she was beaten up
She was shown standing up for people who love her or who she considers as someone weaker than her and asking Akherja to beat her up though is a bit extreme but it went with her character.
Even before also when Kamili was being beaten up over something she went and confessed that it was she who did that
She may be a kid who is sacred of beating but she was only standing for people who love her and who are victims of Akheraj's atrocities along with her.
She may be knowing that he will beat her up but she still stood up for others despite being scared
It can be considered as foolishness or it can be considered as an act of bravery.She knew that she will be beaten but that didn't stop her.