Great observation! The 3D chord in that moment is definitely what people call a secondary dominant. Its function is to cause us to expect (and crave) that movement to the 6- chord. This always involves plagiarizing the 5D chord somehow, but there are lots of variations.
The most common variation is the one we study first in IFR, which gives us the scale 3, 4, #5, 6, 7, 1, 2. This isn’t the mixolydian scale, as you correctly pointed out. If the name is important to you, this is usually called the “phrygian dominant” scale, which is just a fancy way of saying 3D.
What’s happening in the melody is also very understandable if you consider what it really means to tonicize or prepare a chord. It really means momentarily treating it like a “note 1”. So those note 3, #4, #5, 6 are just a reference to the notes 5, 6, 7, 1 leading up to an imaginary note 1 (which in this case is actually note 6).
So you can think of this as just a more extreme version of 3D. Not only are we bringing in the #5 to make this a dominant chord (giving our destination a natural 7th), but we’re even bringing in #4 to give our destination a natural 6th as well. So when we play the notes 3, #4, #5, 6, our ear will relate to this very comfortably as our old friends 5, 6, 7, 1 leading up to our destination.
This is probably a good moment to remember that nothing we study in IFR ever limits what you can play. All of these sounds are right there on your tonal map, and they all produce different effects. So there is no “right” scale to play over a 3D chord. It’s just that the notes 3, 4, #5, 6, 7, 1, 2 are the most common and the ones most people will instinctively imagine in this moment. But another very pretty sound that we can imagine in this moment are the notes 3, #4, #5, 6 because this tonicizes note 6 even more strongly. Now we’re plagiarizing the 5D chord even more, reminding the ear of the familiar path of notes 5, 6, 7, 1.