ALBANY — After a string of defeats in recent years from California to Maine, the movement to legalize same-sex marriage is hoping its unexpected victory in New York will revive efforts to legalize gay weddings around the nation.

But the movement’s success here could prove difficult to replicate. Twenty-nine states have constitutional bans on same-sex marriage, while 12 others have laws against it. And many of those states where support for same-sex marriage is high have already acted on the issue.

Officials at several gay-rights organizations said they would seek to move quickly in Maryland, where legislation to legalize same-sex marriage was shelved in February by Democratic leaders concerned that it lacked the support to pass.

Advocates also said they hoped to resuscitate a marriage bill that died in the Rhode Island legislature this year.