Ultimately the issue was getting the LD_LIBRARY_PATH set to /opt/sqlanywhere12/lib64 for Apache.
Setting it in /etc/environment got isql -v TP189902 and php connect.php working when called from any shell user, but not Apache.
To get Apache to see it, I had to edit /etc/init.d/apache2 and change
ENV="env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin"
ENV="env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/sqlanywhere12/lib64".
And then restart the Apache service. Various other methods I found online to do this did not work.
One caveat is that with the path set, unixODBC still won't read my system DSN file for some reason. So to get Apache to access the DSN, I had to make a user DSN file (.odbc.ini) in /var/www, as that's the Apache user's (www-data) home folder.