Generalization of Waveguide Invariants and Application to Passive Time Reversal