In situations like this and many others, I recommend you compare the etymology of the words, even if this "only" will give you the history of the words and not necessarily the current, modern meaning. There are so many words in English which have their roots in French, Latin etc. In the case of query vs question, they both seem to originate from the same meaning (in Latin):
"question" is derived from Anglo-French questiun, Old French question question, "difficulty, problem; legal inquest, interrogation, torture" from Latin quaestionem (nominative quaestio) "a seeking, a questioning, inquiry, examining, judicial investigation" noun of action from past participle stem of quaerere "ask, seek".
"query" originates in Latin quaere "ask," imperative of quaerere. (see above)
My interpretation/guess: perhaps "question" is closer to the noun-form, while "query" is closer to the verb, even if both can be used as nouns/verbs.