British Prime Minister Theresa May won a key victory over her plans to leave the European Union - but lost a junior minister in the process.