IMO "come out ahead" does not have an equivalent, (many idioms don't), and should be translated on case-by-case basis. Pls provide the whole sentence