As a related result, the set of Dophantine sentences consistent with $Q$ is decidable, see https://mathoverflow.net/a/194502 .
Let me remark that while the answer above exploits the weakness of $Q$ which allows for quite pathological models, reasonable stronger base theories can still make a trouble. In particular, it is a long-standing open problem whether the universal fragment of the theory of quantifier-free induction ($\mathit{IOpen}$) is decidable; if it is, then one can construct a counterexample $T$ as above with $T\supseteq\mathit{IOpen}$. [EDIT: While I’m pretty sure the existence of models of $\mathit{IOpen}$ with decidable existential theory is also an open problem, it’s stronger than decidability of its universal fragment: we would need decidability of Boolean combinations of $\exists$ sentences, or some kind of amalgamation property.]
[2] Verena H. Dyson, James P. Jones, and John C. Shepherdson, Some diophantine forms of Gödel’s theorem, Archiv für mathematische Logik und Grundlagenforschung 22 (1982), pp. 51–60. http://gdz.sub.uni-goettingen.de/index.php?id=resolveppn&PID=GDZPPN002045400https://eudml.org/doc/137991