Others already listed these points of view in favor of F#
- Up/down notehead motion is clearly visible
- Only one accidental is needed for the bar
- Temporary "looks like key of G", so the F# is like the leading tone in G, or the third of a D major chord
I'd like to add one more rule-of-thumb for deciding on what's the proper enharmonic spelling, and that is: what is the set of seven simultaneously possible scale notes during that moment. The idea with traditional harmony and practice of notating with note position and accidentals is, there are seven possible notes per octave, and each of the seven notes can be natural, sharp or flat. (Or double sharp etc.) If F has been made sharp, it implies that there should not be an F natural at the same time. But if G is flat, then it implies that having Gb and F simultaneously would fit the writer's idea of harmonic possibilities.
During the note in question, which of the following do you feel like being the set of seven simultaneously possible notes:
- C, D, E, F#, G, A, B
- C, D, E, F, Gb, A, B
Try playing them as scales and also play the notes simultaneously as chords. The option with Gb has a fairly non-traditional sounding sequence of E - F - Gb, and jump from Gb to A. Out of those notes, you could construct, say, a D minor chord, D - F - A, and you could still play a Gb over it... Is that how you feel about it? Or do you feel that if there's a D based chord, it should be a D major, D - F# - A?
In some musical styles like jazz, the seven-notes-per-octave thinking isn't so strict, and there are things like the diminished scale that has eight notes per octave, where seven-note thinking isn't the best fit for describing musical ideas. The staff notation system, accidentals etc. developed or evolved for use in a culture where seven-notes-per-octave thinking was the prevailing assumption. It's written language for a certain culture.