Translation:They had written to us last month.
There is no way to hear the difference even for a native French speaker, unless there is another clue in the phrase eg 'Les filles, elles nous avaient etc' as opposed to 'La fille, elle nous avait etc'. So Duolingo needs to accept either a singular or a plural response as correct. Infuriating, but it's a free App and the best around so perhaps we shouldn't carp?
I agree with both your example sentences. They both refer to or imply events that occurred before something else happened in the past, either the near or distant past. That is when one normally uses the pluperfect. "He had knocked upon arrival five minutes ago". (But nobody answered the door ___ implied but not directly stated).
I am not sure that the English Past Perfect should (not that it is not) used where there is a clear reference to the time something happened, as opposed to the time BEFORE it happened. As there is not 100% correlation between tenses in English and French, I surmise the sentence should actually be translated as 'They wrote to us last month'. That said, I'd better not risk losing my umpteenth heart.
Why could this not be translated "the last month." if this is a previous time maybe ten years ago or 100, the speaker might be recounting what HAD happened long ago in the last month of someone's life and have a letter that was written the last month of the life of the subject of the sentence . "In 1944, before they went to war as nurses, they had written to us the last month." the last month of their lives, their last month as civilians, etc.
"the last month" (i.e. final month) = le dernier mois
"last month" (i.e. preceding month) = le mois dernier
For "Sitesurf" please. I have one question; I guess one was answered already here about the difference in pronunciation for singular/plural. Can you tell me here, if "nous" is the "DO", and if so why is "ecrit" not "ecrits(es)". Please answer at your own ease and convenience. Impatient, s'il vous plait !