St. Andrews mayor loses court battle against RM council that