On the number of ramified primes in specializations of function fields over $\mathbb{Q}$