If you never found the child's parents, you'd have to call CPS. Being prevented from finding the child's parents, just necessitates you move that step forward.
Of course, it's not 'your job' so technically you could abandon the child at any point but it does feel a bit heartless to give a kid hope, then say 'meh you're on your own, this is too troublesome'. As for just leaving the child with others who are complaining, I doubt that's a good idea. They were making no move to help, and bystander effect will probably keep them from ever doing a thing.