Supersymmetric indices on $I \times T^2$, elliptic genera, and dualities with boundaries