Yes.
Assuming that the person is incarcerated under federal law, Congress can and has retroactively reduced sentences for federal crimes (sometimes resulting in a release from prison entirely) and indeed has done so rather recently.
And, at the federal government level, there is no prohibition on Congress passing "special legislation" that only affects select people. So called "private laws" that affect only one person or a small number of people are passed every year. The process for passing private laws is discussed here.
The Bill of Attainder clause of the U.S. Constitution prohibits Congress from passing a law that declares someone to be guilty of a crime. But the converse, a law that vacates someone's prison sentence, is not barred by the Bill of Attainder clause.
Congress would not generally have the power to vacate a sentence imposed under a state or local law that was valid at the time, although the U.S. Supreme Court, on rare occasions, does so by finding a state law prison sentence to be unconstitutional. Similarly, it is well established that the Presidential pardon power does not extend to state and local government established crimes.
This distinction is very material.
As of 2019, about 1,255,689 people currently behind bars in the United
States—or 87.7% out of a total of 1,430,805 prisoners—had been
convicted in state court for violating state criminal laws, rather
than in federal court for violating federal criminal laws.
The proportion of criminal cases brought in state court rather than
federal court is higher than 87.7% because misdemeanor and petty
offense prosecutions are disproportionately brought in state courts
and most criminal prosecutions involve misdemeanors and petty
offenses.
The number of trials conducted in each system is another way
to illustrate the relative size of the two criminal justice systems.
In Colorado, in 2002, there were approximately 40 criminal trials in
federal court, and there were 1,898 criminal trials (excluding
hundreds of quasi-criminal trials in juvenile cases, municipal cases
and infraction cases) in state courts, so only about 2% of criminal
trials took place in federal court. Most jury trials in the United
States (roughly five out of six jury trials conducted in any U.S.
Court) take place in criminal cases in state courts.
There might be some conceivable circumstances in which federal law could vacate a a particular state prison sentence (although probably not any circumstance present in Donald Trump's state court criminal cases), for example, as part of an international peace treaty, although I'm not aware of any precedents for cases where that has ever actually happened.
Obviously, of course, Congress can't set someone incarcerated by another country free just by passing a law that says that they should be released.