Answer:
29 inches
Explanation:
For the following I just used trial and error and experimented with the possibilities:
29 inches - This is the only one that does not work.
30 inches - We can use 5 of the 6 inch trains, so this is possible.
31 inches - We can use 4 of the 6 inch trains and 1 of the 7 inch trains, so this is possible.
32 inches - We can use 3 of the 6 inch trains and 2 of the 7 inch trains, so this is possible.
33 inches - We can use 2 of the 6 inch trains and 3 of the 7 inch trains, so this is possible.