Both nice tractors but the comparison needs to be defined a bit more. What do you want, an hst or gear machine. If HST the Montana 3440HST is the comparison you want.
In either case the 3040 is not really comparable to either. The 3040 Mitsubishi engine performs incredibly well. It is smooth, reliable and strong. The 3040 comes with many, many standard features like draft, 2 remotes, elec./hyd pto, rear work light, folding ROPS, your choice of tires. and if you are looking at the new fel it is incredible. It is the model 100 curved boom loader that is skid steer compatible.
I like this tractor a lot and think in the 30hp range it is hard to beat at any level. I think you need to be looking at the Grand L series to get a more close comparison to the Montana's premium compacts.
Both good tractors so I would check out the dealers, drive each model you are interested in and see what is best for you. Much of it depends on info not provided so it is hard to say much more than this.
Thanks,
Maka