First of all, the clefs are not quite right and the bottom part should be an octave lower (this is inferrable from the illegal 4th in the penultimate bar).
Modes in Renaissance style are not the strict collections of 7 notes used in "modal" pop and jazz songs. Instead, a mode tells us where the tonic is located within a field of 11 notes, 7 diatonic and freely used (A,B,C,D,E,F,G) and 4 chromatic (B-flat, F-sharp, C-sharp, and G-sharp).
Flats are used primarily to avoid the tritone; thus if your melody wants to go to B but the cantus firmus is on an F, you can use B-flat instead. (Flats are used for other purposes too, such as the "una nota super la" rule and certain cadences in Dorian, but that's another story.)
Sharps are used primarily in cadences, as you correctly point out, and also in cases which at the time were caused "causa pulchritudinis": using a major third in a triad which would normally be minor for its richness of sound (an epic example is the opening phrase of Palestrina's "Stabat Mater").
It appears that Fux is trying to achieve the latter category of effect but, as is clear from reading an updated counterpoint manual such as Jeppesen or Gauldin, he got a few things slightly wrong. A sharped note should function melodically as a leading tone to the next higher note; in this case, the F-sharp would be correct if followed by G, although that would cause problems in the next bar.