As long as the wheel rim is in contact with the rail you should have current available - the flange contact isn't really an issue.
For the derailing aspect, it can be worth checking that nothing (wires) obstructs the swing of the bogie.
This - https://www.dccconcepts.com/product/powerbase-mini-magnet-pack-x24-smaller-magnets/ - can be a way of getting greater contact force on the rail, without adding mass that makes the climb even harder.
Always worth cleaning the rails (and wheels) and seeing if things are any better then.
With the Pendelino, one of the problems was that sudden power changes, from a cheapo set controller, coupled with traction tyres on one side only, caused the bogie to 'climb out' and derail. A flywheel would have helped a lot, but wasn't really practical, a bit of 'slide' from metal wheels was the answer in the short term. A bit of extra mass, over the driven bogie(s) was also a possible benefit.