Yes you can use sugar water and push everything back in as well however the chances are since it appears to be a congenital issue, it will likely not go away, or at least it will happen again. It is most likely that this animal will have to undergo surgery to fix the issue.
Try this and see how it goes and make sure nothing series out https://ball-pythons.net/forums/show...apsed-Hemipene!
The issue with prolapse is that if the tissues stays outside for too long it will dry out and get necrotic.