I tested this today. I immediately joined and started fighting, did 40-50k worth of damage and then stopped. Once the dragon was defeated, I finished my dragon off. I did not receive any medals even though I dealt damage prior to it dying.
I also confirmed with others in the kingdom that only one person received the rewards (presumably the one who registered the first kill).
Tomorrow I will test if retreating after dealing damage gets you rewards (if I am awake at the time).