Yes, Tomato works on the WRT54G-TM.
I got mine working by flashing to DD-WRT first. I was not able to go directly to Tomato so I don't recommend attempting to do so.
Step by step instructions:
1) Verify you have a WRT54G-TM. T-Mobile sometimes sells a new variety of Linksys router that may or may not be compatible with any of these instructions (WRT54UG-TM).
2) Download the latest version of Tomato (all the various versions of it come in one zip file) and download 7-Zip while you're still connected to your normal internet connection, if you haven't installed it already.
3) Follow all of the instructions for installing DD-WRT on your router:
Some help with those instructions:
When they tell you to download the newest version, finding it is a little confusing. Go here:
Scroll to the bottom. The "svnXXXXX" labels are links - click the bottom one (which is the most recent). Download the first file in the page that comes up - it will end with "NEWD_mega.bin". I successfully used svn11482 without issue.
When they tell you to run the ping -t command, it's important to use -t. The goal is to ping that IP address continuously until the new CFE you pushed to the router starts replying to pings. So they'll fail fail fail until the CFE wakes up and says hello. You can then press Ctrl+C in the command window to kill the endless pinging.
4) The time for CFE to load took 30 seconds. The time for DD-WRT to load took less than a minute, which is signalled both by a reply to the above ping and also the response by visiting 192.168.1.1 in a browser.
5) IMPORTANT: You have to use DD-WRT with Internet Explorer. A browser like Google Chrome or Safari will NOT work properly - DD-WRT generally freaks out. Most importantly the only thing you plan to do - upload Tomato - fails gloriously. The upload page vanishes before the upload completes resulting in nothing happening whatsoever and DD-WRT sticking around.
6) Updating the firmware is as simple as you'd hope. In DD-WRT in Internet Explorer, click Administration. Then click Firmware Upgrade. Say yes to wanting to reset the firmware once the upload is complete (this fixes the password differences between DD-WRT and Tomato) and then Browse to the proper Tomato file in the zip you downloaded - which is named WRT54GS.bin. Click the button to start the upgrade and wait.
The bar will go up for about 30 seconds. Pinging will fail a bit then begin replying. Then the power light on the router will stop flashing and go solid on. That means you can visit 192.168.1.1 again (in any browser you like this time) and tada - TOMATO!