Roy, wife of Assam Public Health and Engineering Minister Gautam Roy, polled 52,791 while AIUDF's Mehbubul Hassan polled 51,880 votes, official sources said.
AGP's Kamrul Islam Choudhury polled only 933 votes and BJP's Sashadhar Pal polled 2,742 votes.
There were 12 candidates in the fray and besides the Congress and AIUDF, BJP, AGP and eight Independents had contested the polls.
Byelections to Algapur was necessitated following the death of AGP MLA Sahidul Alam Choudhary on November 20 last.
The predominantly minority constituency was spread across Hailakandi and Cachar districts in Barak Valley.
The Congress increased its tally in the 126-member Legislative Assembly to 79, while the AGP went down to eight members from its earlier nine in the current Assembly.