Complex sentence: By 1897 the Carioca railway had been completely electrified, to become the first totally electric tramway system in South America, and electrification expanded rapidly over the next two decades, and by 1928 the last horse-drawn trams had been withdrawn from service.
Split into simpler sentences: By 1897 the Carioca railway had been completely electrified, making it the first totally electric tram system in South America. Electrification expanded rapidly over the next few decades, and by 1928 the last horse-drawn trams had been withdrawn from service.