SYDNEY — Australia’s Parliament voted overwhelmingly Thursday to legalize same-sex marriage, overcoming years of conservative resistance to enact change that the public had made clear that it wanted. The final approval in the House of Representatives, with just four votes against the bill, came three weeks after a national referendum showed strong public support for same-sex marriage.