Politicians are more likely to follow public opinion that (a) heavily favors one side of an issue, (b) holds steady, or (c) affects voting choice.
I am not entirely sure there can be a clear answer to this question because much of it is dependent on how an individual candidate perceives their position in an election. Making the assumption that the candidate is judging their reaction to a particular issue in terms of winning votes and winning an election, a candidate's specific context and condition in a race might determine what they do. It is difficult to speak in broad and sweeping terms because all political leaders' actions are contingent on context and situation. If a candidate is comfortably ahead in polling data and in election projections, perhaps they hold steady on an issue rather than take a position outright that might sway the voting bloc in a mobilized fashion. In contrast to this, if a candidate is behind and time is a concern, perhaps they need to "go big" and favor voting choice in the hopes of moving a sizable chunk of the electorate to their side in the hopes of capturing momentum. I do believe that most if not all elected leaders hope to be on the side of the issue that most voters are. This will help sustain their own credibility to the people to which they are accountable. At the same time, it is political expedience to see that the individuals who are elected officials, seeking validation from the voters, are on the same side of an issue as their constituents. This is where all elected officials would like to be, but specific races and contexts can always play a role in how officials in a political setting will act and in what they will or should do.