Isaiah 40 announces comfort for Israel and commands preparation of a highway for YHWH.
Isaiah 40:3 is the direct background.
The one whose way John actually prepares is Jesus. John therefore applies a YHWH-coming text within the narrative of Jesus' arrival.
The argument is cumulative rather than based on the word 'Lord' alone: the Gospel identifies Jesus as the one who fulfills the role occupied by YHWH in Isaiah's promise.