Why did some counties within Confederate Appalachian states (Parts of Tennessee, Kentucky, and West Virginia, etc) oppose secession despite their location inside the CSA? Did it have anything to do with historic political differences between the mountaineers and their agriculturally-powered state governments?
Yes, you have basically answered your own question.
These regions, eastern Tennessee, western Virginia and North Carolina, and to a lesser degree in northern Alabama (as well as northern Arkansas, although not considered part of Appalachia) had fewer slaves and dependence on a slave-based economy than most of the rest of the south. Consequently most of these areas also had closer geographic, economic, and cultural ties with non-slaveholding northern cities, such as Cincinnati and Pittsburgh, than to southern cities.
This also drove a longstanding resentment of slaveholder-dominated state legislatures. In the future West Virginia, for example, issues like taxes on slaves being set at a third of market value and a perceived favoring of the eastern part of the state for internal improvements help drive anti-Confederate feeling; people had no enthusiasm for a war that seemed to them to be for the benefit of these wealthy elites who had never done anything for them. Furthermore, there was no security in secession, rather they knew the border states/upper south would be the first to see bloodshed.
As for Kentucky, it may be worth noting that state never formally succeeded, although it later had seats in the Confederate Congress, and tried to remain neutral at the start of the war. The Confederacy did not help public opinion by being the first to enter the state, occupying Columbus.
Sources:
Mackey, Robert R. The Uncivil War: Irregular Warfare in the Upper South, 1861-1865
McPherson, James M. Battle Cry of Freedom: The Civil War Era
Sewell, Richard H. A House Divided: Sectionalism and Civil War, 1848-1865