Reminds me of the Harry Turtledove alternate history novel “The Guns of the South”, where stereotypical white Boer racists go back in time to arm the Confederate army with AK’s so they win and preserve slavery. They also gave Lee some medicine for his heart to keep him alive. Lee screwed them over and freed the slaves anyway IIRC.
;>)
The key is for the people with the modern weapons to have a good defensive position.
The Spartans would do no better, as long as they can be induced to mass attack the entrenched modern fighters.