The Conservatives and Labour have each gained a council seat in Edinburgh after emerging victorious in a double by-election.