Gender-neutral passport rules are 'unlawful', Court of Appeal hears