Electrothermal treatment of ores or metallurgical products for obtaining metals or alloys