But don't those Total Stock Market indices have some kind of weighting for each stock? Wouldn't changes in the weightings just leave you with the same problem? Or maybe I'm missing something?
They do, but Vanguard (and probably other fund companies) take a number of steps to help prevent frontrunning. For one, Vanguard recently moved its benchmark provider to FTSE Group (CRSP) for many funds, which takes more of an averaged trade-price approach to determining weights. They also delay trades and "packet" securities between indexes and buffering small changes in market cap from predicting trades.
It's not impossible for someone to squeak some money out of the predictability of an index, but it's not something that makes a ton of material difference with a company like Vanguard.