In the end, he was deceived by Tamar. When he realised that it was he by whom Tamar was pregnant, he recognised his own sinfulness. Presumably, he repented for he did not continue with Tamar (Genesis 38:26). In time, when Jacob sent his sons to Egypt to buy grain, it was Judah who guaranteed Benjamin's safety (Genesis 43:8-9) and Jacob accepted that pledge (cf. Reuben's in Genesis 42:37). It was Judah who pleaded with Joseph to spare Benjamin and therefore Jacob's life at his own expense (Genesis 44:33-34). Judah came round.
God works in mighty, mysterious ways. He would make his children face their own sins and humble them, in order that they might arise unto greatness, not of their own doing but of the Lord's. Why did Reuben, Simeon and Levi not repent? But what does it matter for us who have the benefit of hindsight - who do we want to emulate?
Lord, the chastening is painful and wearying to the soul but I guess you are also deepening me where I have been shallow. Grant me the perseverance to follow you through and emerge a better, stronger, meeker person.
Conflict is a curious gift because it sharpens us, demanding grace and forgiveness... Someone without frictional relationships is indeed a poor soul, for we are best formed in the crucible of conflict.
~ Glenn T Stanton, 'Up for Debate,' in CT, January 2009, p.41.