City doesn’t need to return child to birth mother’s care, Brooklyn judge rules