Things are not always what they seem, and this is one of such. What we have in the expression “forlorn hope” is really an English spelling of a Dutch phrase, not at all a translation.
The Dutch spelling is verloren hoop, which sounds very much like the English “forlorn hope.” But hoop doesn’t mean “hope”; it means “troop” or “band.” And verloren doesn’t quite mean “forlorn”; it means “abandoned” or “wasted”
The Dutch term is of military origin; it designated a small band of soldiers, usually volunteers, who undertook some perilous expedition, such as heading an attack against the foe, or rushing forward the scaling ladders to breach a fortress.
In modem military parlance they would be called “shock troops.”
But because casualties were very high and the chance of success always doubtful, “forlorn hope” has now the non-military meaning, “an enterprise having little prospect of success.”