Head of Brooklyn middle school later apologizes; City employees in are prohibited from using their roles or education department resources to engage in political activity