“Pink Floyd rescues Trinidadian boys born to Isis dad”: it reads like a headline from US satirical outlet the Onion. But the information is real, and the issue it highlights is no laughing matter.

On 21 January, Roger Waters, co-founder of the British rock band Pink Floyd, helped rescue two young brothers from a camp in Syria that was holding wives and children of foreign Islamic State members. Mahmud Ferreira, 11, and his brother Ayyub, 7, have been reunited with their mother and are poised to return to their native Trinidad. The boys were taken to Syria by their father – reportedly now dead – in 2014. A few years later they were found abandoned on a roadside, and put in the camp run by the Kurdish-Arab forces controlling northeast Syria.

About 1,250 children from 46 countries have been held for up to two years in camps in Syria with no end in sight

Waters pulled off Mahmud and Ayyub’s rescue with UK-based human rights lawyer Clive Stafford Smith. If only the dozens of governments whose nationals are trapped in Syria because they are children of Isis members would show similar concern. About 1,250 children from 46 countries – including at least 12 from Britain – have been held for up to two years in camps in northeast Syria with no end in sight. Many are toddlers. The children have not been charged with any crime, and the local authorities have repeatedly called on their countries to take them. Yet most governments balk at bringing them back, claiming they may be security threats.

Conditions in these camps, which Human Rights Watch has visited, are often squalid, with inadequate food, shelter, healthcare, and education provided. Many children are traumatised and several need surgery, family members and activists told me. In most cases the children are held with their mothers, but their fathers are imprisoned, missing, or dead. Some, like Mahmud and Ayyub before their rescue, are on their own.

To be sure, Mahmud and Ayyub’s case is clearer than most: their mother in Trinidad never joined their father in Syria and had been trying to bring them home. Many children lack identity papers – particularly those born in Isis-held territory – and some are orphans. Several were born to parents of two different nationalities. All of this makes it difficult to establish citizenship or legal guardianship.

Further complicating matters, many mothers detained in the camps say they don’t want their sons and daughters sent home without them, but governments are even more reluctant to repatriate adult relatives of Isis members. What’s more, many countries have no diplomatic ties with Syria or the Kurdish-majority coalition controlling northeast Syria.

While the challenges and security concerns are legitimate, they are no reason for countries to remain, in the words of a Pink Floyd song, comfortably numb. Indeed, Russia, Kazakhstan, Indonesia, Sudan and the United States have taken back some wives and children of Isis members from Syria.

France on Tuesday announced it would accept – but prosecute – any adult French Isis members who are deported or otherwise return from camps in northeast Syria, and in October said it was planning to repatriate French children.

We can no longer just stand by while children are dying in war zones | Gordon Brown Read more

Birth certificates are on file for many children in their home countries. Other children’s identities can be established through DNA tests with grandparents or other family members. The children, along with their mothers, can be evaluated on returning home – monitored, and, if necessary, prosecuted in line with international fair trial and juvenile justice standards. In such cases, children should be prosecuted only as an exceptional measure and not for membership of groups such as Isis in the absence of evidence of violent acts.

Left in limbo by their governments, these children face indefinite arbitrary detention and potential statelessness. It shouldn’t have to take Pink Floyd to bring them home.

• Letta Tayler is the senior terrorism and counterterrorism researcher at Human Rights Watch