In what ways can the legal system ensure a balance between individual rights and public order during communal violence trials?

The Delhi riots case involves issues of public order and individual rights. I am curious about how the legal system manages this balance when dealing with communal violence.