Near-Optimal Lower Bounds on Quantifier Depth and Weisfeiler-Leman Refinement Steps