In what ways can the judiciary balance religious freedoms with gender equality in sensitive cases like Sabarimala?

The Supreme Court is reviewing the Sabarimala verdict, which involves complex issues of religion and women's rights. I am curious about how courts can ensure justice without hurting religious sentiments.