I wouldn't attempt to answer this question if the following article wasn't available.
Kaiser, W. C., Jr., Davids, P. H., Bruce, F. F., & Brauch, M. T. "137:8–9 A Call for Revenge?" (1996). Hard sayings of the Bible, (p. 280-282). Downers Grove, IL: InterVarsity.
Their beginning paragraph summarizes the difficulty with Psalm 137:8-9.
Many tenderhearted believers have read these words with shock and chagrin. They are frankly at a loss to explain how one could speak with what appears to be such malice, vindictiveness and delight of the sufferings of others, especially children. How can the gentleness of the opening verses of this psalm be harmonized with the call for such brutal revenge in the last verses?
-- Kaiser, p. 280
On the issue of Exodus 10:13 most modern translations translate it, "Do not murder." However, when you include the rest of the Torah. There are plenty of commands to annihilate cities in the Promised Land.
The Hebrew language possesses seven words related to killing, and the word used in this sixth commandment appears only forty-seven times in the Old Testament. This Hebrew verb, rāṣaḥ, refers only to the killing of a person, never to killing animals, and not even to killing persons in a war. It carries no implications of the means of killing.
--
Kaiser, "20:13 You Shall Not Take Life?," p. 148
The senses of רצח as used in the MT (Logos Bible Software).
Jesus' command to love your enemies is a better contrast to Psalm 137:9.
But I say to you, Love your enemies and pray for those who persecute you, 45 so that you may be sons of your Father who is in heaven. For he makes his sun rise on the evil and on the good, and sends rain on the just and on the unjust.
(Matt. 5:44–45, ESV)
But this doesn't settle the issue for Christians because Jesus quotes Psalm 137.
The words “dashes [your infants] against the rocks” are usually regarded as being so contrary to the teachings of the New Testament that here is little need to discuss the matter any further. Curiously enough, these very same words are repeated in the New Testament by no one less than our Lord (Lk 19:44). In fact, the verb in its Greek form is found only in Psalm 137:9 (in the Septuagint, the Greek translation of the Hebrew text) and in the lament of our Lord over Jerusalem in Luke 19:44. This is the clearest proof possible that our Lord was intentionally referring to this psalm. Moreover, our Lord found no more difficulty in quoting this psalm than he did in quoting the other two psalms most filled with prayers of imprecation, namely, Psalms 69 and 109.
--
Kaiser, p. 281
There is also much in Revelation that keeps Christians from discounting Psalm 137. For example:
When he opened the fifth seal, I saw under the altar the souls of those who had been slain for the word of God and for the witness they had borne. 10 They cried out with a loud voice, “O Sovereign Lord, holy and true, how long before you will judge and avenge our blood on those who dwell on the earth?”
(Rev. 6:9–10, ESV)
A important thing to consider:
The word translated “infant” [עֹ֝לָלַ֗יִךְ] is somewhat misleading. The Hebrew word does not specify age, for it may mean a very young or a grown child. The word focuses on a relationship and not on age; as such, it points to the fact that the sins of the fathers were being repeated in the next generation.
--
Kaiser, p. 281
I can't conclude the answer better than this:
What, then, does “Happy is he who repays you for what you have done to us—he who seizes your infants and dashes them against the rocks” mean? It means that God will destroy Babylon and her progeny for her proud assault against God and his kingdom. But those who trust in God will be blessed and happy. For those who groaned under the terrifying hand of their captors in Babylon there was the prospect of a sweet, divine victory that they would share in as sons and daughters of the living God. As such, this is a prayer Christians may also pray, so long as it is realized that what is at stake is not our own reputation or our personal enemies, but the cause of our Lord’s great name and kingdom.
--
Kaiser, p. 282
The book Hard sayings of the Bible in the articles about Exodus 20:13 and Psalm 137:8-9 has much more detail than I could practically include here.