If, on the trial of a person charged with an indictable offence relating to elections the evidence establishes that the person is not guilty of the offence charged, but is guilty of an offence relating to elections and punishable on summary conviction, the person may be convicted of such last mentioned offence, and is liable to the same punishment as if the person had been summarily convicted of that offence.