Definetly The one with more knowledge , if my local imam is not as knowledable n gives me a fatwa n than i call the grand mufti in saudi arabia who gives me a diffenet fatwa i go by the one whom i expect to be more knowledgable , it can never be about being local or distant , the ulama are easily in reach , most o f the times when i cal sheikh ubaid al jabiree he answres after asr n before maghrib , same with other big scholars , so we should always stick to te big scho9lars who are more knowledgable.
rember what Ibn sireen said
This knowledge is deen , so be careul WHOM u take ur DEEN from!
Always take it from the big schoolars , n i have ad it many times that soem of the local imams fatwa were more lienient n they allowed certain things but when i checked with biger ulama they were very strict n completely forbade me.
N we are living in times where communcations is very easy , plus soo much fatwa n stuff are on internet already , so why n How in Earth would the local imam get priority? when more knowledgable people who are fatr away are easily reachable throug al the means of communication that we have.