Ministers have pledged to push through legislation to give same-sex couples equal rights to get married despite mounting opposition from within the Conservative party and the threat of a split with the Church of England.