adjective
DUBIOUS : The police did their best to rescue the hostages but in vain.
BAD : The police did their best to rescue the hostages but without success.
DUBIOUS : She tried to get him to listen but in vain.
GOOD : She tried in vain to get him to listen.
GOOD : She tried to get him to listen but it was all in vain.
GOOD : She tried to get him to listen but to no avail.
◆◆◆
In vain usually comes after verbs such as try, search, hunt, look, wait, fight etc or after the verb be : 'Her voice was beginning to rise and she tried in vain to control it.' 'A team of surgeons battled in vain to save him.' 'I was never in any doubt that my efforts would be in vain.' In other situations, use without success or to no avail : 'They did everything they could to protect her, but (all) to no avail.