It depends on the system. If it's perfectly symmetric in long/short, detrending is not necessary. If not, detrended results are more realistic. Use detrending also for training, otherwise the training would be affected from trend artifacts.

It is unusual that you got good results when detrending for testing and not for training. I would normally expect the opposite.