That Mercadona is near the Figueres station. I'd expect the TGV to depart from Figueres Vilafant, though I haven't verified that.
I don't remember seeing anything inside Vilafant when I passed through there in 2019, and there's no indication of a food source there on Google Maps. There's a place that sounds to me like a bakery, Alexis Forn de Pa, not too far from Vilafant at Carrer Ramon Reig 26. Google Maps tells me it delivers, and it has a rating of 4.7. Some bakeries sell sandwiches.
If you zoom in on Google Maps and move gradually from Vilafant back toward the museum, you'll see some restaurants that are flagged as doing delivery and/or takeout, so I think you'll have options. I spotted a Thai place with a rating of 4.7.