The main point of my question is, what can a medical student do to set themselves apart and have a higher chance of getting into a registrar program.
The answer to this depends heavily on what specialty you are aiming for & the easiest answer is going to be to try and look at the C.V. marking criteria for specific training programs.
In terms of research most of them have a time limit requirement, i.e. only research done in the last 5 years and only with yourself as first author are counted towards C.V. marks. Similarly, most will only accept research within the field that you're trying to get into.
Generally most medical students don't have a 100% clear idea of what they want to do and even if they are certain this often changes a lot over their medical school years & during their time as a junior doctor. The risk with doing research specifically for getting into a training program then is that you commit a lot of time and effort into something that doesn't achieve your goal either due to not being in the field or missing out on time.
That perspective though largely discounts all the other immaterial benefits that come from doing research other than just points on a C.V. Research usually gets you heavy exposure to senior staff, gives you insight into the specialty, teaches you how to critically approach problems as well as fostering an ability to enact change and improvement.
Above all the most important thing when doing research of any kind is that it's on something you are interested in - if it isn't then the entire thing will be a grind and it will probably put you off forever.
If you are purely looking for something that will help you get onto training programs then my suggestion is to do volunteer work and/or leadership / executive committee work. A lot of competitive specialties have this as part of their marking criteria for the C.V., it is usually a relatively flexible arrangement (for volunteering) and it also gives you experience that is both useful in real life and can be talked about in interviews.
A couple C.V. marking criteria are linked below for reference
Surgery -- all are on here with a couple clicks:
Specialty specific eligibility criteria & selection processes
ICU:
https://www.cicm.org.au/CICM_Media/...ured-Scored-Curriculum-Vitae-2021-Scoring.pdf
O&G:
https://ranzcog.edu.au/RANZCOG_SITE...ng/CV-application-scoring-guidelines-2021.pdf
Physician -- doesn't list a scoring system.
Anaesthetics -- doesn't list a scoring system but their selection criteria are outlined on page 8 of this document
https://www.anzca.edu.au/resources/all-handbooks-and-curriculums/anzca-training-handbook