As already mentioned in the comments, a free ultrafilter considered as a subset of Cantor space (or Cantor set) cannot be analytic, so the answer to the Question 1 is No. (Even without the assumption that the given ideal is P-ideal; we get that no maximal ideal can be analytic.)

This follows immediately if we show that ultrafilter is *not Lebesgue measurable* or if we show that it does *not have the Baire property.* (Since both properties are true for any analytic set.)

Question 2 basically asks whether the restriction to the subset $X$ is a maximal ideal (an ultrafilter). Notice that $X\notin\mathcal I$ implies that $X$ is infinite, so this is rather similar to the original situation. Moreover, since $A\mapsto A\cap X$ is a continuous map $2^\omega\to 2^X$, the restriction will be analytic if the original ideal (filter) was. So the answer to Question 2 is No as well. This was pointed out in Jing Zhang's comment.

Let me quote relevant parts from Blass, Andreas (2010), "Ultrafilters and set theory", Ultrafilters across mathematics, Contemporary Mathematics, 530, Providence, RI: American Mathematical Society, pp. 49–71, doi: 10.1090/conm/530/10440
(From the beginning of section 6. Ultrafilters, Descriptive Set Theory, and Determinacy, page 64.)

This paper is also mentioned as a reference in the current revision of the Wikipedia article Property of Baire, where the fact that ultrafilters do not have Baire property is also mentioned.

... we can ask about its behavior with respect to notions like Baire category and Lebesgue measure. The answer is that
the behavior is bad.

**Theorem 6.1** (Sierpinski [64]). A non-principal ultrafilter on $\omega$, regarded as a subset of $[0,1]$ is not Lebesgue measurable.

The proof uses the zero-one law for Lebesgue measure (see [56, Thm. 21.3]) to infer that, if a non-principal ultrafilter were measurable, its measure would be
$0$ or $1$.
But the measure-preserving reflection $x\mapsto 1-x \colon [0,1]\to[0,1]$ maps the ultrafilter to its complement (except for countably many points), so the measure of the ultrafilter would have to be $1/2$.

A similar argument, using the Baire category analog of the zero-one law [56, Thm. 21.4], shows that a non-principal ultrafilter cannot have the Baire property.
(A set has the Baire property if it differs from some open set by a meager set.)

After this, the paper continuous with discussion of relation of ultrafilters to non-determined games.

The references mentioned above are:

[56] John Oxtoby, *Measure and Category*, Springer-Verlag, Graduate Texts in Mathematics 2 (1971).

[64] Waclaw Sierpinski, *Fonctions additives non completement additives et fonctions non mesurables*, Fund. Math. 30 (1938) 96–99; https://eudml.org/doc/212991

A proof can also be found in Asaf Karagila: *Zornian Functional Analysis or: How I Learned to Stop Worrying and Love the Axiom of Choice*, http://karagila.org/2016/zornian-functional-analysis-or-how-i-learned-to-stop-worrying-and-love-the-axiom-of-choice/ (Wayback Machine) and http://karagila.org/wp-content/uploads/2016/10/axiom-of-choice-in-analysis.pdf (Wayback Machine)

**Theorem 30** (Oxtoby’s Zero-One Law). Suppose that $T\subseteq 2^{\mathbb N}$ has the Baire property and is closed under finite modifications, then T is meager or $2^{\mathbb N}\setminus T$ is meager.

**Theorem 31.** Suppose that $\mu$ is a finitely additive probability measure on $\mathcal P(\mathbb N)$ which vanishes on finite sets.
Then $T=\{a\in 2^{\mathbb N}; \mu(A)=0\}$ does not have the Baire property in the topological space $2^{\mathbb N}$

Theorem 31 is given here with proof.
Schechter's Handbook of Analysis and Its Foundations, Th. 20.33, p. 544, is provided as a reference for Theorem 31. The proof given there is from the paper Miller and Živaljevic, Remarks on the zero-one law, Mathematica Slovaca, vol. 34 (1984), issue 4, pp. 375-384, https://eudml.org/doc/31650

The proofs of the facts mentioned above and some related references can be also found online.

Ultrafilters are not measurable:

Ultrafilters do not have Baire property:

maximal ideal, which is at the same time analytic P-ideal, or is the wordmaximalintended to mean a maximal element of the set of analytic P-ideals ordered by inclusion? (Probably the latter, since we know that existence of p-points cannot be shown in ZFC, but it would be probably good to clarify this in the post.) $\endgroup$ – Martin Sleziak May 26 '17 at 12:45Analytic ideals and their applications,Annals of Pure and Applied Logic, Volume 99, Issues 1-3, Pages 51-72 doi: 10.1016/S0168-0072(98)00051-7. (Probably the OP can clarify and edit the post - although from the comments posted so far, it seems that Solecki's results are probably not that relevant to the question.) $\endgroup$ – Martin Sleziak May 27 '17 at 9:01