A second 16-year-old boy has been arrested under the Terrorism Act after an incident outside a mosque.