Thanks for all the responses, but sorry I didn't give more details.
The boy is seven and small for his age. He just started lessons this summer and is playing some music on the black keys and some on the white.
I may have misled you, putting the word "keybed" in the thread title. It's not the horizontal surface on which the keys are placed that is the place he's putting his thumbs (what I think AZN meant by "resting thumbs on that rail.") The boy is putting his thumbs on the vertical wood surface at the front of the piano, a little bit below the rail.
To describe it a different way, it's almost as if he's trying to push the piano toward the wall, using his thumbs, without them touching the keys at all.
Am I giving you a clearer picture of what I mean?
Pianistlady used the word "brace," which describes well what I'm seeing:
As a result, there are alignment problems and the student feels like they need to brace against something.
He does this more when he's playing black-keys-only pieces, because those notes are fingered with 2, 3, and 4, and there's nothing for the thumb to do. There's a lot of tension in his hands because of pushing his thumbs against the wood. Maybe I should take him off the black-key pieces and get him to play only white-key-pieces that use the thumb often?