Judges based in London have ruled that Brigadier Priyanka Fernando has diplomatic immunity.
Lawyers representing Majuran Sathananthan said he was considering his legal options.
Sir Julian Flaux and Mrs Justice McGowan delivered a ruling on Friday.
The two judges had considered the case at a High Court hearing in December.
They heard that Brigadier Fernando had, in February 2018, drawn his fingers across his neck in a cut-throat gesture three times while watching the demonstration outside the Sri Lankan High Commission in London.
Mr Sathananthan, who was taking part in the demonstration, began a private prosecution and accused Brigadier Fernando, who has now returned to Sri Lanka, of threatening behaviour
A district judge at Westminster Magistrates’ Court had concluded that Brigadier Fernando was not entitled to diplomatic immunity because the acts complained of did not form part of his “job description”.
Sir Julian and Mrs Justice McGowan had considered the case after an application by lawyers representing Brigadier Fernando.
They have allowed an appeal and concluded that Brigadier Fernando had immunity from prosecution.
Lawyers at the Public Interest Law Centre, who represented Mr Sathananthan, said the judges’ ruling was “extremely disappointing”.
They had argued that Brigadier Fernando’s actions were “performed in his personal capacity and outside the exercise of his functions”.
A spokesman for the centre said, in a statement posted on Twitter: “Majuran Sathananthan, one of peaceful protesters from a Tamil community group who was threatened by Brigadier Fernando… is now considering his legal options going forward.”