Generally speaking, criminal records cannot be expunged or sealed after the death of the person with the criminal record, except by special private legislation or a large symbolic pardon from the Governor or other person with pardon power. See, e.g., here. Scholarly analysis of the merits of allowing this practice can be found here and here. It is usually a purely political act done for political reasons. It is almost always done to highly the injustice of the convictions expunged.
But, Texas does allow this to be done for Texas convictions, in cases when expungement would have been available while the person was alive.
In other words, it can't be done by a court in most states, including California, whose expungement rules are summarized here. However, it is not clear if that link reflects California legislation enacted in 2022, effective July 1, 2023, that makes it much easier to seal criminal records in California:
California lawmakers approved one of the most far-reaching criminal
justice reform measures in the nation this year, a bill that drew
relatively little fanfare among a parade of high-profile legislation.
The new law makes California the first state that will automatically
seal most criminal records for those who complete their sentences.
Advocates pushed for the change because they said such records can
prevent once-incarcerated people from getting jobs, housing, schooling
and more. Jeff Selbin, the director of the Policy Advocacy Clinic at
the U.C. Berkeley School of Law, called the legislation “the most
expansive and comprehensive record-clearing law of its kind in the
country.”
The measure, which builds on an earlier state law, takes effect in
July and will automatically seal conviction and arrest records for
most ex-offenders who are not convicted of another felony for four
years after completing their sentences. Records of arrests that didn’t
lead to convictions will also be sealed.
There are some exceptions: People convicted of serious and violent
felonies, as well as those requiring sex offender registration, won’t
have their records cleared under the law. And criminal histories would
still be disclosed in background checks when people apply to work in
education, law enforcement or public office.
Still, this law doesn't contemplate the posthumous sealing of criminal records, although the bureaucracy might automatically seal them, not knowing that someone is dead.