Amtrak from SAN to ANA takes about two hours. Metrolink doesn't go all the way to San Diego, but you could take the San Diego equivalent - Coaster - to Oceanside, then board Metrolink the rest of the way to Anaheim. I figure it would be easier and faster to stick with Amtrak though.
I understand that ART now serves the Anaheim Amtrak/Metrolink station, or you can get a cab there. Too far to walk.