The two companies were sentenced on 17 November at Guildford Crown Court.
The court was told that Wetton Cleaning Services employee Roger Lower, 46, was working a night shift at the West Marina Depot in St Leonards-on-Sea, Hastings.
He had been washing the exterior of a train before his colleagues found him lying on the live rail on 24 May 2014. Emergency services were called but they were unable to save his life.
The prosecution was brought by the Office of Rail and Road (ORR). Its inspectors found that four protection boards designed to keep workers away from the live rail had been leant up against buffers and were not in use.
The ORR said it found Southeastern, which operates train services in south east London, Kent and parts of East Sussex, and Wettons both had a "culture of cutting corners", including inadequate training and supervision, no safe system of work and a reliance on safety paperwork at the depot.
Southeastern's owner, London and South Eastern Railways (LSER), ran the depot, which it leased from Network Rail for washing trains. LSER had subcontracted Wettons for this purpose.
LSER was found guilty of breaching s 3(1) of the Health and Safety at Work Act, while Wettons was prosecuted under s 2(1) of the same act. They were fined £2.5m and £1.1m respectively and both ordered to pay costs of £162,000 each.