If an evil character was under undetectable alignment, would align weapon or a holy weapon automatically work or does the spell fool it, or does something else happen?
Undetectable alignment only protects against divinations, and aligned weapons aren't divinations.
The text of undetectable alignment states that it protects against:
all forms of divination
There is no further text in the description about protection against other aligned effects. The text of, for example, a Holy weapon states:
It deals an extra 2d6 points of damage against all creatures of evil alignment.
The aligned weapon isn't doing any kind of divination against the target, it just hurts more if the target has the right alignment. Likewise, an evil character would take a negative level from picking one up while under the effects of the spell.