Getting arrested at protests has long been a way for New York’s Democratic officials to show solidarity with activists and bring attention to their causes. But these run-ins with the law are often orchestrated affairs that can be different from conventional arrests.