How to prevent having prospective students use me for free help, and then ghost me to go to another university
A student contacts you and expresses an interest to work with you on your research. The student has funding contingent on your letter of acceptance and your approval of their research statement.

Ask the student to prepare a research statement. Tell him/her that you will provide all the necessary resources but that you will not write the statement for them or pre-grade it before it is to be submitted. Point them to the resources about your research, including Web pages, journal articles, and presentation abstracts. Provide them with a template research statement for a research project entirely unrelated to your field yet fully complete to be accepted in the other field. For example, when you are in a biology department doing research on gene expression, have a colleague in the physics department draft a statement on quantum dot fluorescence that he/she would accept as a suitable application. Alternatively, prepare a well-written application to a ballet theater group that expresses an interest to be Juliet in the upcoming production of Romeo and Juliet.

After that, let it be.

After all, do you really want/need to employ PhD students or postdocs who cannot initiate efforts on their own to prepare a coherent statement of their interest in your research?