Probing initial baryon stopping and equation of state with rapidity-dependent directed flow of identified particles