It's not. You're free to leave as an H1B at any time, it's just that you have to leave the country also (or find a new job really fast). It sucks for employees, and it has negative effects on the job market, so there are many good reasons to kill it with fire - but no, it's not indentured servitude, and people who choose this, choose it of their own free will, and can withdraw that decision (and be back to where they were when they made it) at any moment.
Of course it's not literally slavery or indentured servitude, but it does share some common elements that are useful for our analysis. In particular, they both involve voluntary commiting yourself to restrictive labor in exchange for coming to the US.