Yes, you can do this. There are multiple ways of achieving it.
1) You could just do 2 equal preference dial-peers on CUBE pointing to the 2 TDM GWs and calls will randomly load balance over them.
2) You could set up 2 dial-peers with different preferences and which case all calls will go to the primary dial-peer TDM GW and only if that one fails will calls be routed to the secondary dial-peer TDM GW.
3) You can set up an OOD SIP Options ping (keepalive) from CUBE to the TDM GWs so that the trunks between them are monitored and if the trunk to one GW goes down, the dial-peer will be busied out and calls will go to the other GW (for which the turnk is up).
CH