With his position still undeclared, Senator Mark J. Grisanti, a Republican from Buffalo who had sought office promising to oppose same-sex marriage, told his colleagues he had agonized for months before concluding he had been wrong.