There are three ways to reconcile the two passages.
First, the word of the LORD came to Elijah in the third year. In the third year could mean at some time during the third year. For example, Scripture describes David's 7-year reign from Hebron as 7-years and 7-years and 6-months (ESV):
And the time that David reigned over Israel was forty years. He reigned seven years in Hebron and thirty-three years in Jerusalem. (1 Kings 2:11)
six were born to him in Hebron, where he reigned for seven years and six months. And he reigned thirty-three years in Jerusalem. (1 Chronicles 3:4)
Both statements are in agreement; one is more precise than the other.
Second, as some commentators note [1 Kings 18:1] there is a natural 6-month dry period period between the early and latter rains. Elijah's prediction there would be a drought would not be recognized until after the first 6-months had passed. That is, the first 6-months without rain are normal; they are not part of a drought. Therefore a 3-year drought will always take 3-years and 6-months since a period of no rain for exactly 3-years is only a 2 1/2 year drought plus the normal 6-months between the early and latter rains.
Third, Jesus stated the drought was 3-years and 6-months:
But in truth, I tell you, there were many widows in Israel in the days of Elijah, when the heavens were shut up three years and six months, and a great famine came over all the land, (Luke 4:25)
James is using the precise amount of time of 3-years and 6-months Jesus stated.