James was an original Apostle - Galatians 1:17-19.
Neither went I to Jerusalem, to the apostles who were before me: but I went into Arabia, and again I returned to Damascus. Then, after three years, I went to Jerusalem to see Peter: and I tarried with him fifteen days. But other of the apostles I saw none, saving James the brother of the Lord.
The book of Galations was written after Paul’s second visit to Jerusalem during the meeting at the Jerusalem Church over the mission to the Gentiles( Gal 2:1 Act 15:1-4). James, the Lord’s brother was the Pastor at the time. James, the Lord’s cousin, the previous Pastor of the Church, had been martyred sometime before (Act 12:2).
When Paul is writing the Galation letter he is referring to James by his then title.