It's probably an issue with your config because even if you deleted it, your cfg is saved to the steam cloud. You have to disable this feature and then save your config with the "host writeconfig [name]" command. Then follow these steps to run the game at default settings (https://www.reddit.com/r/truetf2/comments/2frkym/how_do_i_reset_my_tf2_to_fully_default/). If the input lag is still there, it might be a hardware issue, but If it's only in tf2 I assume there's a settings issue that will be fixed with this, and the use of a fresh fps config. By that I mean only keep settings not related to graphics in your auto-exec and class execs, and using a modern FPS config in addition to that.
If they think it's the ram, make sure it's set at the timings it says on the box, normally if there's an XMP (XTREME MEMORY PROFILE!!!) in bios that is ideal. You can also check if it's the ram capacity by checking task manager while in-game. If you're using all your ram capacity, look at how much ram is being used at startup, and then compare that to normal numbers from your operating system to see if you need to do anything. If your idle ram usage is normal, keep excess programs closed while you're playing.
If your ram capacity, timing, and frequency is correct. Use a ram stability test tool to see if it passes. Although if this is an issue I assume your PC would just be blue screening a-lot.
Also try "re-seating" your Graphics card and RAM. Which just means unplugging them, making sure they're in the right slots (your motherboard will have the order you need your ram sticks added written on it. It will probably say 0213; your graphics card should generally be in the slot closest to the CPU) and plugging them back in.
tl;dr if you have an fps config it's probably that.