Is it worth writing and publishing a survey paper while a PhD student
A survey almost certainly would count towards your paper count requirement.
A proof based on common sense is that surveys can generally be hard to distinguish from research papers: there exist review papers that have notable amount of novel work added but are still called reviews. Thus it is very unlikely for your department to put such a distinction.
Publishing your (already finished) survey is worth it.
Your original question states that you have to produce a survey of defendable quality. Then, the effort required is just polishing the survey further to publishable quality and handling the communication with a journal. The reward will be getting a publication, with all its formal (increasing your paper count, see previous paragraph) and informal (getting recognised) positive consequences. Surely worth it!
The proof is again based on common sense: if the pros did not outweigh the effort in your local environment, no work would have made its way further than internal discussions within your department.