Legal victory for Mayor Livingstone