TITLE: Given a family of curves, when does there exist a fibered surface over Spec Z parametrizing them?
QUESTION [12 upvotes]: Let $X_p$ be a projective curve over the finite field $\mathbf{F}_p$ (i.e. a projective  $\mathbf{F}_p$-scheme pure of dimension 1) for every prime number $p$. Let $X_\mathbf{Q}$ be a projective curve over  $\mathbf{Q}$.  When does there exist a flat projective integral normal scheme $X$ over Spec $\mathbf{Z}$ such that the fibre above $p$ is $X_p$ for every prime p and the generic fibre is $X_\mathbf{Q}$?
Suppose that $X$ exists. Then the generic fibre is a smooth projective connected curve over $\mathbf{Q}$. Furthermore, $X_p$ is almost always smooth over  $\mathbf{F}_p$. Also, the arithmetic genus is constant in the fibres of $X$. Moreover, the Hilbert polynomial of $X_p$  is independent of $p$.
Example. Suppose that $X_p$ is a supersingular elliptic curve for all $p$. Then there does not exist such an $X$.

REPLY [16 votes]: I suspect that even if you had a single curve over $\mathbb{F}_p$, you might not find a lift 
to $\mathbb{Q}$.  Below I sketch an argument that works under the assumption that $\mathcal{M}_g$ does not have Zariski dense set of points.  If you believe the conjectures of Lang on rational points, this assumption should be satisfied as soon $\mathcal{M_g}$ is of general type, e.g. if $g \geq 24$.
Lemma.
Suppose that $g$ is an integer such that $\mathcal{M}_g(\mathbb{Q})$ is not Zariski dense in $\mathcal{M}_g$.  Then for all sufficiently large primes $p$, there are smooth curves $C_p$ of genus $g$ defined over $\mathbb{F}_p$ that are not reductions of curves defined over $\mathbb{Q}$.
Proof.
By assumption, the set $Z:=\overline{\mathcal{M}_g(\mathbb{Q})}$ is a proper closed subset of $\mathcal{M}_g$.  In particular, the dimension of $Z$ is smaller than the dimension of $\mathcal{M}_g$.  By the Lang-Weil estimates, the number of points of $\mathcal{M}_g$ modulo $p$ grows as a polynomial in $p$ of degree $\dim \mathcal{M}_g$, since $\mathcal{M}_g$ is irreducible modulo $p$.  Similarly, the number of points of $Z$ modulo $p$ grows as a polynomial in $p$ of degree at most $\dim Z$ (the "at most" comes from the fact that $Z$ need not be geometrically integral).  Thus, for sufficiently large $p$, there will be points of $\mathcal{M}_g(\mathbb{F}_p)$ that are not contained in $Z(\mathbb{F}_p)$.  These points correspond to smooth curves of genus $g$ defined over $\mathbb{F}_p$ that are not reductions of curves defined over $\mathbb{Q}$, as required.