Benchmarks decline for second straight week even as midcaps, banks outperform