Being arraigned/accused of crime has nothing to do with standing for election. Only being on the ballot and satisfying the rules is. The rules are per-state and called "Ballot Access"
Each U.S. State has its own ballot access laws to determine who may appear on ballots. According to the Elections Clause in Article I, Section 4, of the United States Constitution, the authority to regulate the time, place, and manner of federal elections is up to each State, unless Congress legislates otherwise.
From the point of view of Federal Government, you get on the ballot by either being nominated by a party (the party is a private organization and can nominate anyone they want); or fulfilling other ballot access requirement (typically, gathering a required minimal number of signatures); or being a non-ballot write-in candidate.
TL;DR: Short of criminal conviction (and may be even not that), the only way a party candidate on the ballot can be replaced is by having the party - in that specific state - choose a different candidate, in time before the deadline to determine ballot contents (which again depends on a state).
How the parties determine their ballot candidate is 100% outside the purvue of Federal government, parties being private organizations. They have their own internal rules, and can set and change those rules as they see fit, as per their own governance structures.
Notably, if the party's governance structure prevents willy-nilly assigning anyone who didn't win the primary, there's nothing they can do.
I don't have a Presidential level example, but in the Senate elections, we have 2008 case of Ted Stevens in Alaska, who was under criminal investigation and convicted and STILL running for election from "R" side.