Judge prevents mother from taking daughter to church