When Chinese automaker BYD Co. announced plans to build a massive factory in the hardscrabble city of Camacari, in Brazil’s northeastern Bahia state, locals saw a new beginning. After years of economic stagnation following Ford Motor Co.’s exit from the region in 2021, there was hope that the global leader in electric vehicles would bring back well-paying jobs and a brighter future.