Yes, he was certainly justified in this action. As a doctor, and especially the one responsible for Lia's care, it is his duty according to the Hippocratic oath to do no harm. Regardless of the Leeses' religious and cultural beliefs, it is clear that their actions are detrimental to Lia's health. Because of this, Ernst has a duty to get her taken care of properly.
To argue this logically, imagine an individual has cancer, but their relatives believe the tumor is a gift from God or something similar. As the doctor, you are required to inform them of the truth of the situation. If the family does not act on it, in the case of a minor, they are being criminally neglectful. The doctor is then responsible for ensuring that the child does not die from their disease. Since you are in a position of both knowing that the issue is a detrimental health issue and a position of authority with responsibility for their health, it is up to you to take action and ensure the child is taken care of.
That was Ernst's situation in this book. In fact, he could have been criminally prosecuted for not taking necessary action when he knew the dangers of the Lia's disease. He was certainly justified and in reality had little other choice at that point.