There are some inexpensive Mom-and-Pop type motels in East Glacier, that you could walk to from the train, and a youth hostel as well. There are some reasonably-priced restaurants there, too, as well as basic grocery supplies. All in all, it's a pleasant little town to stay in, though there's nothing in terms of night life, or that sort of thing. The problem is transport from East Glacier into the park -- the only scheduled bus service is the service provided by the park concessionaire. You'd ride the cool old red busses, but the schedules are limited and rigid, and prices are high. Really, unless you're fine with doing just a single guided bus tour, you almost need a car there.
West Glacier also has a couple of Mom-and-pop motels and a couple of restaurants, and a fairly well-stocked grocery. Motel prices are a little higher than in East Glacier. Again, you're disconnected from the park's mass transit system, though in this case the park's free shuttle busses are only about 2 miles away, so you could conceivably walk to the transit center at Apgar. There's a Park Service campground adjacent to the transit center there, and so if you wanted to camp that would be the place to do it ... but there's no public transport from the train station to the campground, so you'd probably have to hike it. And in the summer, the Apgar campground fills up most nights, so if you're coming from the east on Amtrak the campground would very likely be full by the time you got there. Other campgrounds would be available, but you'd need a car to reach them.
There are definitely people who take Amtrak to Glacier and camp there, but not a lot of them. If you do it, you need to be prepared for the possibility of cold weather and uncertain weather conditions. Though it's rare, I've been snowed on in Glacier in early August!
So overall, a low-budget Amtrak trip to Glacier is doable, but fairly complicated. Having a car up there makes all the difference in the world, even if arriving by train. The concessionaire's red bus tours are the only real choices from East Glacier, but they're expensive and you miss a lot. Without a car in West Glacier, you'd need to be fine with the idea of walking a couple miles at the beginning and end of each day.