Lawyers acting for AVAAZ told judge Lord Sandison last month that Scottish ministers were wrong to not order an unexplained wealth order (UWO) probe against the former US president.
The group wanted the Scottish Government to have a so-called McMafia probe on how Mr Trump obtained the funding for Menie golf course in Aberdeenshire and the Turnberry resort in Ayrshire.
Advocate Aidan O’Neill QC told the Court of Session that ministers didn’t understand the terms of the Proceeds of Crime Act 2002.
The court heard the Scottish Government’s current approach to UWOs allowed the Lord Advocate to have a role in deciding whether such probes should be launched.
Lord Sandison was told the legislation didn’t allow the Lord Advocate to have such a prominent role.
However, Lord Sandison found the evidence showed Scottish ministers had acted lawfully and in line with the legislation.
In a written judgment issued on Thursday, Lord Sandison rejected the arguments made the New York-based group.
Concluding that arguments about the Lord Advocate’s prominent role in unexplained wealth orders was wrong, Lord Sandison wrote: “I do not find it possible to discern from section 396D any implicit Parliamentary intention that the Lord Advocate may not hold portfolio responsibility as the Scottish minister concerned with applying for a UWO, whether in relation to a politically exposed person or otherwise.
“All that the section in essence says is that once a Unexplained Wealth Order has been granted and apparently complied with, the Scottish ministers are to decide whether to give the Lord Advocate the opportunity to take the case forward under the Proceeds of Crime Act functions, which are allocated specifically to her under that Act or whether to take it forward under the POCA provisions which are allocated to them generally under that Act, or indeed to take neither course of action.”
The Scottish Green Party first called for an unexplained wealth order amid questions about how Mr Trump had managed to finance the purchases of the courses at Turnberry in 2014 and at Menie in Aberdeenshire, in 2006.
The UK Government introduced the orders to help investigations into money laundering and other criminal financial activity.
Patrick Harvie, the Greens co-leader, has said Mr Trump's unusual pattern of spending and the ongoing civil and criminal cases in the US provided Scottish authorities with the grounds to investigate the businessman.
First Minister Nicola Sturgeon told the Scottish Parliament the responsibility for the investigation lay with the Crown Office’s Civil Recovery Unit, which was politically independent from the government.
The then-justice secretary Humza Yousaf later announced Ms Sturgeon was mistaken – and that the law did allow for the Scottish Government to launch an unexplained wealth order investigation.
This prompted AVAAZ to instruct lawyers to go to the Court of Session.
In October, Mr O’Neill said that by looking at the legislation, the court would see that it was Scottish ministers and not Scotland’s most senior prosecutor, the Lord Advocate, responsible for ordering an unexplained wealth order investigation.
The Scottish Government contested the action. Its legal team told the court that it had acted lawfully in the affair.