Definition:
Unproductive of success.
That does not produce the result you want.
If you describe a hope that something will happen as a vain hope, you mean that there is no chance of it happening.
If people are vain, they are only concerned with how they look.