If the stitching has come undone but the trouser fabric and old crease are still intact, you can usually put the hem back by hand. Use the original fold to keep the length and a blind hemming stitch to keep the thread discreet on the outside. Check what failed What you see What to do …