I had the misfortune (through my own stupidity) of being a partipant in a pistol (G19) v. rifle (AK-47). I would consider myself reasonably well-trained and my opponent to be untrained. Distance involved was approximately 100 yards. In the end, it was a draw.
What really made the difference was my ability to place reasonably accurate fire on his position, in return. My training program at the time included a significant amount of shooting at 50 yards plus and it paid off.
Distance was my friend. It exploited his lack of training and allowed me to put my superior training to work to close the capability cap between my pistol and his rifle.
Closing the distance was not really a viable option for me. However, doing so really would have put me at a significant disadvantage.