A Lower Bound and a Near-Optimal Algorithm for Bilevel Empirical Risk Minimization