RUBIES: JWST/NIRSpec resolves evolutionary phases of dusty star-forming galaxies at z ∼ 2