Could she be having sensitive nose? Cos if yes when child lie down, the mucus from nose will back flow to the throat and that is why the cough comes when she sleeps. My son used to have and i gave him raw pure honey to stop cough or manuka honey. I just gave one teaspoon direct. It helps to relieve his cough. Don't get any honey from supermarket cos those are usually highly processed ones with added sugar which is no no for cough.
Agree with yellowbeetle. My kids are all diagnosed with sensitive nose after moving into Punggol. In fact, all the kids that I know of (those that I'm close to), all diagnosed with sensitive nose, including those that don't live in Punggol. You've got to treat the sensitive nose first, before the cough and phlegm will go away....
I've not tried the manuka honey but heard that it's good.