The Swordfish was due to be replaced as a frontline carrier strike aircraft in 1939/40 by the Albacore, and was largely replaced by the Albacore by late 1941, and the Albacore, in turn, was due to be replaced by the Barracuda by 1941/42. Consequently it's a bit incorrect to compare the TBD to the Swordfish, however, the big advantage the Swordfish had over the TBD was it's versatility and it's ability to carry a wide variety of sensors, ordnance loads and auxiliary fuel tanks. Finally it was fully capable of dive bombing and could even release a torpedo after a dive bomb attack profile, where the TBD was structurally incapable of a DB attack profile.
Hypothetically, if the Swordfish replaced the TBD at Midway, they would have been launched well before dawn and been out scouting for the IJN via their ASV radar in total darkness, to hopefully make a night attack to avoid IJN CAP. If they had to be launched for a daylight attack, they could be outfitted with bombs (2 x 500lb and 2 x 250lb would be typical) to augment the SBD DB attacks, or they could retain torpedoes but approach at medium altitude and use a DB attack profile, to help evade flak and increase the probability of surprise.
On paper the Swordfish is much slower than the TBD, but in service the TBD was much slower than it's oft reported speeds and so it really wasn't that much faster than the Swordfish.