I think we should separate these into separate cheats. The max train cheat is quite buggy and makes all rides default to 31 trains including flat rides. The train length cheat on the other hand is pretty much bug free for the most part and probably the more useful of the two parts anyway. I was able to manually revert the code for the 31 trains on my end and it improved the behavior substantially.
Another suggestion would be to fix the default train length on rides to be based on the station length and number of blocks. Essentially run the normal checks when the ride is first built like normal and then allow the user to manually increase the train and car counts. I tried figuring out how to do this but the train length calculations and codes have some very strange logic thats hard to follow.
Fixing the buggy behaviour is a much better approach than adding another cheat option that does almost the same thing.
The game auto-populates the ride with the maximum number of trains because the ride is initially set at 31 trains (the preferred number of trains). The actual number of trains is the minimum of the preferred number of trains and the maximum number of trains. The cheat simply sets the latter at 31.
A fix: the preferred number of trains should be set at 'uninitialized' until the player manually changes it (or the ride opens), and the behavior should be changed so that 'uninitialized' is interpreted as the original maximum number of trains.
Most helpful comment
Fixing the buggy behaviour is a much better approach than adding another cheat option that does almost the same thing.