Q. Does someone have to fast if when entering early to shul, he sees of a pair of Tefilin laying on the ground, that apparently fell from their bag when the shul was being cleaned?

A. In principle since he did not cause himself the desecration of the Tefilin, he does not truly have to fast.
However, out of the deep sorrowful distress of witnessing the above desecration, that as mentioned by Horav Shlomo Miller’s Shlit’a, has similarities to being present at the terrible anguished, tragic burning of a Sefer Torah, one should do something praiseworthy for the benefit of Tefilin in that shul, such as arranging that Tefilin should be checked by a qualified Sofer.

Rabbi A. Bartfeld as revised by Horav Dovid Pam, Horav Aharon Miller and Horav Chanoch Ehrentreu Shlit’a