With what sort of material is the courtyard fenced? The ducklings will not need a very large opening to get out. However, if the courtyard is completely enclosed, then they may need help out of the courtyard. Mallard ducks are protected by federal law. I am not sure of their protection by New York state laws. I'd recommend that you contact a local wildlife biologist to ask what should be done to assist the ducklings if indeed they cannot leave the courtyard without human assistance. If I have the locations correct, I think you will need to contact: Department of Environmental Conservation Wildlife Management Region 3 fwwildlf@gw.dec.state.ny.us 845-256-3098
If that isn't the number you need, they should be able to direct you to the appropriate biologist. Good luck.