If the defendant prevails in the suit he shall recover his costs of the person by whom it is prosecuted, unless authorized to prosecute the same in behalf of the state.