Yes, it counts as Zakat. The Glorified Allah explains the groups that can receive Zakat as follows:
“Zakat expenditures are for the poor, the desperate (masakeen), those employed to collect Zakat and those to warm their hearts (to Islam); and are used for freeing captives, for those in debt, for the cause of public interest and for the people that work in public service. This is an obligation by Allah. Allah is All-Knowing and The Wise.” (At-Tawbah/The Repentance 9:60)
According to this, giving Zakat to imam hatip schools counts as giving it for the public interest.
 In Turkey, an Imam Hatip school is a secondary school that educates students especially to train government employed imams and preachers, which are choice of many students to learn more of their religion nowadays. Arabic, Qur’an and Islamic sciences are mainly taught besides other secondary school lessons in imam-hatips.