When Capt. Nilesh Gandhi’s oil tanker docked in coronavirus-ravaged China early last month, he understood that he would not be able to disembark and fly home as planned. He would have to keep working, at least until Singapore.

But when he arrived there, Singapore had prohibited all crew changes. And when he docks in Sri Lanka next week, the government there will ban him from getting off the ship. Saudi Arabia and the United Arab Emirates, his next two stops, forbid crew members from leaving, as well.

He is not alone. An estimated 150,000 crew members with expired work contracts have been forced into continued labor aboard commercial ships worldwide to meet the demands of governments that have closed their borders and yet still want fuel, food and supplies.

“We want to go home,” said Mr. Gandhi, 38, in a phone interview from aboard his ship.

His wife and son expected him home in Mumbai, India, more than a month ago. He said seven others — four Indians and three Filipinos — are similarly stranded on the ship. They are still being paid, but crew members say that, given the choice, they would have gladly declined the money and returned home.