There could be a number of things causing your tomato seedlings to whither, it sounds like what is commonly known as "damping off." This is when the stems of young seedlings begin to rot near the soil surface from disease organisms attacking the germinating seeds. Damping off is usually caused by overwatering.
To prevent this problem from occurring, give the seedlings a light watering to keep the soil consistently moist but not soggy. Temperature and light are also factors to consider. A day temperature of 70 to 75 degrees and a night temperature of 60 to 65 degrees is ideal. Seed trays should be placed in an area with indirect light and good air circulation so that the seedlings have plenty of sun, but not a high degree of heat associated with the light. Finally, when you sow your seeds, be sure to use new, sterile potting soil.