CARACAS, Venezuela — Venezuela’s autocratic president, Nicolás Maduro, is widely expected to win another term in elections Sunday. But he soon could face a far bigger test — maintaining his grip on a country that is fast becoming a failed state. Since Maduro took over from Hugo Chávez — his mentor, who died in 2013 — Venezuela’s crisis has steadily intensified as a result of lower oil prices, corruption and a socialist system plagued with mismanagement. But as Maduro has sought to further consolidate power in the past 12 months, the economy, public services, security and health care have all but collapsed. Armed gangs and Colombian guerrilla groups are operating unchecked on Venezuela’s borders.