Pls see Quran’s verse 2:54 on this incident. Exodus 32:26-28 also mentions it and talks about killing them literally. However many mufassirin, both classical and modern, are of the opinion that verse 2:54 of Quran is not talking about literal killing. Please see the translation of Asad and his footnote to it here, which explains in detail:
2:54 and when Moses said unto his people: “O my people! Verily, you have sinned against yourselves by worshipping the calf; turn, then. in repentance to your Maker and mortify yourselves;39 this will be the best for you in your Maker’s sight”. And thereupon He accepted your repentance: for, behold, He alone is the Acceptor of Repentance, the Dispenser of Grace.
Note 39 (Muhammad Asad)
Lit., “kill yourselves” or, according to some commentators, “kill one another”. This literal interpretation (probably based on the Biblical account in Exodus xxxii, 26-28) is not, however, convincing in view of the immediately preceding call to repentance and the subsequent statement that this repentance was accepted by God. I incline, therefore, to the interpretation given by `Abd al-Jabbar (quoted by Razi in his commentary on this verse) to the effect that the expression “kill yourselves” is used here in a metaphorical sense (majazan), i.e., “mortify yourselves”.