The ESV is more faithful to the Semitic world in which Jesus lived, and is the way someone in that time & place would have actually said it. The NIV is more faithful to the way this would be understood in English--the ESV conveys the word, the NIV conveys the meaning.
The thinking organ
A useful passage to reference is found in Deuteronomy 6
4 Hear, O Israel: The Lord our God is one Lord:
5 And thou shalt love the Lord thy God with all thine heart, and
with all thy soul, and with all thy might.
Citing the above passage, Claude Tresmontant observed:
When we translate literally the Hebrew be-kol lebabeka as 'with all
you heart,' we evidently cannot be faulted too badly. After all the
Hebrew leb does mean 'heart.' Nevertheless because the 'heart' was
considered by the ancient Hebrews to be the organ of the intelligence
and not of affectivity, we fail to render the true meaning of the
sentence when we translate leb literally. To love with all one's
heart for us it to love with very great emotion and affection;
understanding this command in that fashion, we are unlikely to realize
that we were really commanded in this passage to love God with all our
mind or intelligence. (The Hebrew Christ p. 190)
New Testament usage
It is interesting therefore to note how the Gospel of Matthew renders the passage from Deuteronomy when quoted by Jesus:
Jesus said unto him, Thou shalt love the Lord thy God with all thy
heart, and with all thy soul, and with all thy mind. (Matthew 22:37)
Despite being very faithful to the Hebrew structure of the passage in Deuteronomy (more-so than are Mark or Luke), the Greek of Matthew preserves meaning by adding a word not found in the original Hebrew text (although Matthew also excludes a word too). The rendering/translation of this passage is discussed by Tresmontant as well:
"[The writer] was evidently well aware of the full meaning of leb and the
full range of possible translations. Accordingly, he included both of
the applicable Greek words." (The Hebrew Christ p. 191).
Greek vs. Hebrew
The word in Luke is καρδίᾳ ("hearts"); whether this conversation happened in Greek, Aramaic, or Hebrew the effect is the same--this was a culture in which the heart was the thinking organ. "Heart" in English does not convey that meaning, and so the sense of the word has been lost.
This is a genuine translator's dilemma--which is why it is unsurprising that different translators have handled the passage differently. Do you translate the word (heart) or the meaning (the thinking organ)?
There's no reason to question that He said "hearts", and in the world in which He lived, it conveyed what we today would more appropriately render as "minds".